mirror of
https://github.com/apple/pkl.git
synced 2026-09-13 13:21:47 +02:00
Implement toString() on VmReference (#1692)
This is still needed right now, because some methods call through to `toString()`.
This commit is contained in:
@@ -117,7 +117,7 @@ j: K = new {
|
||||
|
||||
refInterpolation = "\(aRef.outputs.someListing[1])"
|
||||
kInterpolation = "\(k)"
|
||||
aValuesJoined = k.aValues.join("\n").replaceAll(Regex("@[a-z0-9]+"), "@<addr>")
|
||||
aValuesJoined = k.aValues.join("\n")
|
||||
|
||||
// ensure that type arguments that are unions are handled correctly
|
||||
typeArgs = ref.Reference(d, TypeHolder, null).prop as Ref<Listing<Number | Boolean | String>>
|
||||
|
||||
@@ -50,11 +50,11 @@ j {
|
||||
refInterpolation = "${a.outputs.someListing[1]}"
|
||||
kInterpolation = "new K { aId = Reference(new D {}, String, new A { name = \"a\"; id = \"some-a-value\" }).id; bId = Reference(new D {}, String, new B { name = \"b\"; id = \"some-b-value\" }).id; aProperties = Reference(new D {}, reference#AProperties, new A { name = \"a\"; id = \"some-a-value\" }).outputs; bProperties = Reference(new D {}, reference#BProperties, new B { name = \"b\"; id = \"some-b-value\" }).outputs; aValues { Reference(new D {}, Int, new A { name = \"a\"; id = \"some-a-value\" }).outputs.foo; Reference(new D {}, Int | Null, new A { name = \"a\"; id = \"some-a-value\" }).outputs.someMapping[\"key\"]; Reference(new D {}, Int, new A { name = \"a\"; id = \"some-a-value\" }).outputs.someMap[new MapKey { k = 123 }]; Reference(new D {}, Int, new A { name = \"a\"; id = \"some-a-value\" }).outputs.someListing[0]; Reference(new D {}, Int, new A { name = \"a\"; id = \"some-a-value\" }).outputs.someList[9223372036854775807]; Reference(new D {}, Int, new B { name = \"b\"; id = \"some-b-value\" }).outputs.nonString }; bValues { Reference(new D {}, String, new B { name = \"b\"; id = \"some-b-value\" }).outputs.foo; Reference(new D {}, Null | String, new B { name = \"b\"; id = \"some-b-value\" }).outputs.someMapping[\"key\"]; Reference(new D {}, String, new B { name = \"b\"; id = \"some-b-value\" }).outputs.someMap[new MapKey { k = 123 }]; Reference(new D {}, String, new B { name = \"b\"; id = \"some-b-value\" }).outputs.someListing[0]; Reference(new D {}, String, new B { name = \"b\"; id = \"some-b-value\" }).outputs.someList[9223372036854775807]; Reference(new D {}, String, new A { name = \"a\"; id = \"some-a-value\" }).outputs.nonInt }; splitUnion = null }"
|
||||
aValuesJoined = """
|
||||
org.pkl.core.runtime.VmReference@<addr>
|
||||
org.pkl.core.runtime.VmReference@<addr>
|
||||
org.pkl.core.runtime.VmReference@<addr>
|
||||
org.pkl.core.runtime.VmReference@<addr>
|
||||
org.pkl.core.runtime.VmReference@<addr>
|
||||
org.pkl.core.runtime.VmReference@<addr>
|
||||
${a.outputs.foo}
|
||||
${a.outputs.someMapping[key]}
|
||||
${a.outputs.someMap[key:123]}
|
||||
${a.outputs.someListing[0]}
|
||||
${a.outputs.someList[9223372036854775807]}
|
||||
${b.outputs.nonString}
|
||||
"""
|
||||
typeArgs = "${null.prop}"
|
||||
|
||||
Reference in New Issue
Block a user