mirror of
https://github.com/apple/pkl.git
synced 2026-09-13 13:21:47 +02:00
Correctly handle type aliases with a type variable as the root (#1714)
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
typealias Id<T> = T
|
||||
foo: Id<Int> = 1
|
||||
@@ -0,0 +1,2 @@
|
||||
typealias Id<T> = T
|
||||
foo: Id<Int> = "oops"
|
||||
@@ -0,0 +1 @@
|
||||
foo = 1
|
||||
@@ -0,0 +1,19 @@
|
||||
–– Pkl Error ––
|
||||
Expected value of type `Int`, but got type `String`.
|
||||
Value: "oops"
|
||||
|
||||
x | foo: Id<Int> = "oops"
|
||||
^^^
|
||||
at typeAlias3a#foo (file:///$snippetsDir/input/types/typeAlias3a.pkl)
|
||||
|
||||
x | foo: Id<Int> = "oops"
|
||||
^^^^^^
|
||||
at typeAlias3a#foo (file:///$snippetsDir/input/types/typeAlias3a.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