Fix name resolution of types in constraints (#1826)
This fixes an issue where type names are resolved incorrectly in typealias constraints. Co-authored-by: Islon Scherer <islonscherer@gmail.com>
This commit is contained in:
1 parent
ac43bdbb17
commit
4dd37219c0
12 files changed
+129
-16
No files matched your search
+5
@@ -1,3 +1,8 @@
|
||||
class MyClass
|
||||
|
||||
typealias MyTypeAlias = MyClass(getClass() == MyClass)
|
||||
|
||||
typealias MyTypeAlias2 = MyClass(this is MyClass)
|
||||
|
||||
// a let expression turns the constraint node into its own root node
|
||||
typealias MyTypeAlias3 = MyClass(let (_ = true) this is MyClass)
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import "typeAliasConstraint2.pkl"
|
||||
|
||||
typealias MyTypeAlias = Any(this is typeAliasConstraint2.MyClass)
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import "../../input-helper/types/typeAliasConstraint2.pkl"
|
||||
import "../../input-helper/types/typeAliasConstraint3.pkl"
|
||||
|
||||
res: typeAliasConstraint2.MyTypeAlias2 = new typeAliasConstraint2.MyClass {}
|
||||
|
||||
res2: typeAliasConstraint3.MyTypeAlias = new typeAliasConstraint2.MyClass {}
|
||||
|
||||
res3: typeAliasConstraint2.MyTypeAlias3 = new typeAliasConstraint2.MyClass {}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import "../../input-helper/types/typeAliasAmendModule.pkl"
|
||||
|
||||
local const function isValid(s: String): Boolean = s.startsWith("Alice")
|
||||
|
||||
res = typeAliasAmendModule.name
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
res {}
|
||||
res2 {}
|
||||
res3 {}
|
||||
+1
@@ -0,0 +1 @@
|
||||
res = "Bob Marley"
|
||||
Reference in new issue
Block a user