Fix name resolution in typealias with constraint (#144)

The body of a typealias gets inlined into wherever the typealias
is used. This fixes a bug where the references in the typealias body can
resolve to the wrong value.
This commit is contained in:
Kushal Pisavadia
2024-02-15 21:28:10 +00:00
committed by GitHub
parent 1c29287344
commit 3d1db25864
11 changed files with 76 additions and 7 deletions
@@ -341,8 +341,8 @@ examples {
"abcdefg"
"abcdefg"
" abcdefg"
"Type constraint `this.length == 1` violated. Value: \"\""
"Type constraint `this.length == 1` violated. Value: \"aa\""
"Type constraint `length == 1` violated. Value: \"\""
"Type constraint `length == 1` violated. Value: \"aa\""
}
["padEnd()"] {
""
@@ -351,8 +351,8 @@ examples {
"abcdefg"
"abcdefg"
"abcdefg "
"Type constraint `this.length == 1` violated. Value: \"\""
"Type constraint `this.length == 1` violated. Value: \"aa\""
"Type constraint `length == 1` violated. Value: \"\""
"Type constraint `length == 1` violated. Value: \"aa\""
}
["toBooleanOrNull()"] {
true
@@ -0,0 +1,2 @@
res1 = "a"
res2 = List("a", "b")
@@ -0,0 +1,3 @@
foo = 1
bar {}
qux {}