From 67182243567ae0b3eb8284ff1c94c0c51ef88a04 Mon Sep 17 00:00:00 2001 From: tmoux Date: Wed, 29 Jul 2020 22:59:45 -0500 Subject: [PATCH] small tidyups --- .gitignore | 2 ++ selfhost/tests/ipair.wyv | 18 ++++++++++++++++++ selfhost/typecheck.wyv | 1 - 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 selfhost/tests/ipair.wyv diff --git a/.gitignore b/.gitignore index 5cf744d27..a8b992ff8 100644 --- a/.gitignore +++ b/.gitignore @@ -109,4 +109,6 @@ selfhost/.js selfhost/main.js selfhost/tests/*.wyb selfhost/tests/*.js +selfhost/failtests/*.wyb +selfhost/failtests/*.js selfhost/output.js diff --git a/selfhost/tests/ipair.wyv b/selfhost/tests/ipair.wyv new file mode 100644 index 000000000..9c8dd5014 --- /dev/null +++ b/selfhost/tests/ipair.wyv @@ -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 diff --git a/selfhost/typecheck.wyv b/selfhost/typecheck.wyv index 9545a5068..704633bec 100644 --- a/selfhost/typecheck.wyv +++ b/selfhost/typecheck.wyv @@ -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