mirror of
https://github.com/apple/pkl.git
synced 2026-09-13 13:21:47 +02:00
Fix incorrect isNoopTypeCheck() calls (#1717)
`isNoopTypeCheck()` is not reliable when inside a TypeNode's constructor. This defers these calls to node execution time.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
typealias MyList<T> = List<T>
|
||||
res1 = List(new Dynamic {}) is MyList<module>
|
||||
|
||||
typealias MySet<T> = Set<T>
|
||||
res2 = Set(new Dynamic {}) is MySet<module>
|
||||
|
||||
typealias MyMap<T> = Map<Any, T>
|
||||
res3 = Map("foo", new Dynamic {}) is MyMap<module>
|
||||
|
||||
typealias MyListing<T> = Listing<T>
|
||||
res4 = new Listing { new Dynamic {} } is MyListing<module>
|
||||
|
||||
typealias MyMapping<K, V> = Mapping<K, V>
|
||||
res5 = new Mapping { ["foo"] = new Dynamic {} } is MyMapping<String, module>
|
||||
|
||||
typealias MyUnion<A, B> = A | B
|
||||
res6 = new Dynamic {} is MyUnion<module, module>
|
||||
|
||||
typealias NestedUnion<A, B> = (A | A) | (B | B)
|
||||
res7 = new Dynamic {} is NestedUnion<module, module>
|
||||
@@ -0,0 +1,7 @@
|
||||
res1 = false
|
||||
res2 = false
|
||||
res3 = false
|
||||
res4 = false
|
||||
res5 = false
|
||||
res6 = false
|
||||
res7 = false
|
||||
Reference in New Issue
Block a user