Skip to content

Commit

Permalink
small tidyups
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoux committed Jul 30, 2020
1 parent 287b8cd commit 6718224
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,6 @@ selfhost/.js
selfhost/main.js
selfhost/tests/*.wyb
selfhost/tests/*.js
selfhost/failtests/*.wyb
selfhost/failtests/*.js
selfhost/output.js
18 changes: 18 additions & 0 deletions selfhost/tests/ipair.wyv
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type Int:z:
def +(i:Int):Int
def -(i:Int):Int

type Pair:z:
type S <= Unit
type T <= Unit

type IPair:z:
type S = Int
type T <= Unit
subtype IPair extends Pair

val ok:Pair{type S = Int, type T = Int} = new this:IPair {type T = Int}:
type S = Int
type T = Int

ok
1 change: 0 additions & 1 deletion selfhost/typecheck.wyv
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ def equalDeclType(a:DeclType, b:DeclType, gamma:List[DeclType]):Boolean = match
default => false
m:MemberType => match b:
u:MemberType =>
//error.report("check: " + typesUtil.typeToString(m.typ) + " , " + typesUtil.typeToString(u.typ),error.unknownLocation)
m.name.name == u.name.name && typesUtil.equalBound(m.bound,u.bound) && equalType(m.typ,u.typ,gamma)
default => false

Expand Down

0 comments on commit 6718224

Please sign in to comment.