diff --git a/packages/collections/_test.pony b/packages/collections/_test.pony index 6bb5ca7c38..bdc2a861aa 100644 --- a/packages/collections/_test.pony +++ b/packages/collections/_test.pony @@ -598,7 +598,7 @@ class \nodoc\ iso _TestSort is UnitTest [""; "%*&^*&^&"; "***"; "Hello"; "bar"; "f00"; "foo"; "foo"], [""; "Hello"; "foo"; "bar"; "foo"; "f00"; "%*&^*&^&"; "***"]) - fun test_sort[A: (Comparable[A] val & Stringable)]( + fun test_sort[A: (Comparable[A] val & Stringable val)]( h: TestHelper, sorted: Array[A], unsorted: Array[A]) diff --git a/packages/collections/persistent/map.pony b/packages/collections/persistent/map.pony index 472eae794f..3c8c353dbf 100644 --- a/packages/collections/persistent/map.pony +++ b/packages/collections/persistent/map.pony @@ -1,6 +1,6 @@ use mut = "collections" -type Map[K: (mut.Hashable val & Equatable[K]), V: Any #share] is +type Map[K: (mut.Hashable val & Equatable[K] val), V: Any #share] is HashMap[K, V, mut.HashEq[K]] """ A map that uses structural equality on the key. diff --git a/packages/collections/persistent/set.pony b/packages/collections/persistent/set.pony index 8b7542cbc1..9a6f227f31 100644 --- a/packages/collections/persistent/set.pony +++ b/packages/collections/persistent/set.pony @@ -1,6 +1,6 @@ use mut = "collections" -type Set[A: (mut.Hashable val & Equatable[A])] is HashSet[A, mut.HashEq[A]] +type Set[A: (mut.Hashable val & Equatable[A] val)] is HashSet[A, mut.HashEq[A]] type SetIs[A: Any #share] is HashSet[A, mut.HashIs[A]] diff --git a/packages/pony_test/test_helper.pony b/packages/pony_test/test_helper.pony index 6d84de6f3a..af033291bb 100644 --- a/packages/pony_test/test_helper.pony +++ b/packages/pony_test/test_helper.pony @@ -159,7 +159,7 @@ class val TestHelper """ _check_eq[A]("eq", expect, actual, msg, loc) - fun _check_eq[A: (Equatable[A] #read & Stringable)] + fun _check_eq[A: (Equatable[A] #read & Stringable #read)] (check: String, expect: A, actual: A, msg: String, loc: SourceLoc) : Bool => @@ -221,7 +221,7 @@ class val TestHelper """ _check_ne[A]("ne", not_expect, actual, msg, loc) - fun _check_ne[A: (Equatable[A] #read & Stringable)] + fun _check_ne[A: (Equatable[A] #read & Stringable #read)] (check: String, not_expect: A, actual: A, msg: String, loc: SourceLoc) : Bool => diff --git a/src/libponyc/pass/names.c b/src/libponyc/pass/names.c index f83e056676..a620905b05 100644 --- a/src/libponyc/pass/names.c +++ b/src/libponyc/pass/names.c @@ -217,18 +217,8 @@ static bool names_type(pass_opt_t* opt, ast_t** astp, ast_t* def) if(tcap == TK_NONE) { - if((opt->check.frame->constraint != NULL) || - (opt->check.frame->iftype_constraint != NULL)) - { - // A primitive constraint is a val, otherwise #any. - if(ast_id(def) == TK_PRIMITIVE) - tcap = TK_VAL; - else - tcap = TK_CAP_ANY; - } else { - // Use the default capability. - tcap = ast_id(def_cap); - } + // Use the default capability. + tcap = ast_id(def_cap); } ast_setid(cap, tcap);