mirror of
https://github.com/apple/pkl.git
synced 2026-09-13 13:21:47 +02:00
Fix type argument lost in constraint expressions within generic typealiases (#1709)
Co-authored-by: Daniel Chao <daniel.h.chao@gmail.com>
This commit is contained in:
co-authored by
Daniel Chao
parent
bfa6a989be
commit
1c1a39e37f
+3
@@ -0,0 +1,3 @@
|
||||
typealias MyList<T> = List(this[0] is T)
|
||||
|
||||
foo: MyList<Int> = List("uh oh")
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
–– Pkl Error ––
|
||||
Type constraint `this[0] is T` violated.
|
||||
Value: List("uh oh")
|
||||
|
||||
this[0] is T
|
||||
│ │ │
|
||||
│ │ false
|
||||
│ "uh oh"
|
||||
List("uh oh")
|
||||
|
||||
x | typealias MyList<T> = List(this[0] is T)
|
||||
^^^^^^^^^^^^
|
||||
at typeAliasConstraint3#foo (file:///$snippetsDir/input/types/typeAliasConstraint3.pkl)
|
||||
|
||||
x | foo: MyList<Int> = List("uh oh")
|
||||
^^^^^^^^^^^^^
|
||||
at typeAliasConstraint3#foo (file:///$snippetsDir/input/types/typeAliasConstraint3.pkl)
|
||||
|
||||
xxx | renderer.renderDocument(value)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at pkl.base#Module.output.text (pkl:base)
|
||||
|
||||
xxx | if (renderer is BytesRenderer) renderer.renderDocument(value) else text.encodeToBytes("UTF-8")
|
||||
^^^^
|
||||
at pkl.base#Module.output.bytes (pkl:base)
|
||||
Reference in New Issue
Block a user