From f973fd6717748158ea942a942c226685900a375e Mon Sep 17 00:00:00 2001 From: Daniel Chao Date: Thu, 8 Oct 2026 13:32:26 -0700 Subject: [PATCH] Change how VmValueRenderer renders Typed values (#1412) This changes it to render the qualified name instead of the simple name. * Module classes render the module name * Classes within module render the module name and the class name joined by `#` * Rendering of members of `pkl:base` does not change For example: * `new k8s.core.v1.Service {}` instead of `new ModuleClass {}`. * `new k8s.core.v1.Service#ServiceSpec {}` instead of `new ServiceSpec {}` * `new pkl.Project {}` instead of `new ModuleClass {}` This affects the following: * `toString()` * `trace()` * Error messages * REPL --- .../java/org/pkl/core/runtime/VmValueRenderer.java | 2 +- .../files/LanguageSnippetTests/output/api/any.pcf | 2 +- .../output/api/propertiesRenderer4.pcf | 2 +- .../LanguageSnippetTests/output/api/reference.pcf | 6 +++--- .../LanguageSnippetTests/output/api/reflect4.pcf | 10 +++++----- .../output/api/xmlRendererInline3.xml | 2 +- .../output/api/yamlRendererStream2.pcf | 2 +- .../files/LanguageSnippetTests/output/basic/as.pcf | 14 +++++++------- .../LanguageSnippetTests/output/basic/string.pcf | 2 +- .../output/classes/constraints3.pcf | 2 +- .../output/classes/constraints7.pcf | 2 +- .../output/errors/anyConverterError.err | 2 +- .../output/errors/constraintDetails1.err | 6 +++--- .../output/errors/constraintDetails2.err | 8 ++++---- .../output/errors/constraintDetails3.err | 4 ++-- .../errors/forGeneratorCannotIterateOverTyped.err | 2 +- .../output/errors/listingTypeCheckError9.err | 2 +- .../output/errors/mappingTypeCheckError11.err | 2 +- .../output/errors/power/typeConstraints16.err | 2 +- .../output/errors/power/typeConstraints2.err | 2 +- .../output/errors/reference1.err | 2 +- .../output/errors/reference19.err | 2 +- .../output/errors/reference2.err | 2 +- .../output/errors/reference25.err | 2 +- .../output/errors/reference3.err | 2 +- .../output/errors/reference4.err | 2 +- .../output/errors/reference5.err | 2 +- .../output/errors/reference7.err | 2 +- .../errors/spreadSyntaxCannotIterateOverTyped.err | 2 +- .../output/errors/undefinedProperty3.err | 2 +- .../output/lambdas/amendLambdaParametersTyped.pcf | 2 +- .../output/lambdas/pipeOperator.pcf | 2 +- .../output/mappings2/wrongParent.pcf | 4 ++-- .../output/projects/badPklProject5/bug.err | 2 +- .../output/projects/badProjectDeps4/bug.err | 10 +++++----- .../output/types/currentModuleType6.err | 2 +- .../output/types/thisType1.pcf | 12 ++++++------ .../output/types/typeAlias6.err | 2 +- 38 files changed, 66 insertions(+), 66 deletions(-) diff --git a/pkl-core/src/main/java/org/pkl/core/runtime/VmValueRenderer.java b/pkl-core/src/main/java/org/pkl/core/runtime/VmValueRenderer.java index 65ebb1c43..7babe75ea 100644 --- a/pkl-core/src/main/java/org/pkl/core/runtime/VmValueRenderer.java +++ b/pkl-core/src/main/java/org/pkl/core/runtime/VmValueRenderer.java @@ -400,7 +400,7 @@ public final class VmValueRenderer { VmClass clazz = value.getVmClass(); append("new "); - append(clazz.getSimpleName()); + append(clazz.getDisplayName()); append(' '); } diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/api/any.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/api/any.pcf index e829cf749..6a7888b4d 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/api/any.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/api/any.pcf @@ -39,7 +39,7 @@ examples { "new Listing { 1; 2; 3 }" "new Mapping { [\"Pigeon\"] = 42; [\"Barn Owl\"] = 21 }" "new Dynamic { name = \"Pigeon\"; age = 42 }" - "new Person2 { name = \"Pigeon\"; age = 42 }" + "new any#Person2 { name = \"Pigeon\"; age = 42 }" "null" "null" } diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/api/propertiesRenderer4.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/api/propertiesRenderer4.pcf index bffd2942e..c4d98faf3 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/api/propertiesRenderer4.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/api/propertiesRenderer4.pcf @@ -11,7 +11,7 @@ res10 = "Cannot render value of type `Map` as Properties. Value: Map(\"name\", \ res11 = "Cannot render value of type `Listing` as Properties. Value: new Listing { \"pigeon\"; \"parrot\" }" res12 = "Cannot render value of type `Mapping` as Properties. Value: new Mapping { [\"name\"] = ?; [\"age\"] = ? }" res13 = "Cannot render value of type `Dynamic` as Properties. Value: new Dynamic { name = ?; age = ? }" -res14 = "Cannot render value of type `propertiesRenderer4#Person` as Properties. Value: new Person { name = ?; age = ? }" +res14 = "Cannot render value of type `propertiesRenderer4#Person` as Properties. Value: new propertiesRenderer4#Person { name = ?; age = ? }" res15 = "Cannot render value of type `Pair` as Properties. Value: Pair(1, 2)" res16 = "Cannot render value of type `Class` as Properties. Value: propertiesRenderer4#Person" res17 = "Cannot render value of type `TypeAlias` as Properties. Value: propertiesRenderer4#Email" diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/api/reference.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/api/reference.pcf index 6d4e9a13d..a54c668ef 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/api/reference.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/api/reference.pcf @@ -50,7 +50,7 @@ j { splitUnion = "${a.outputs.someListing}" } 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; nullProp = Reference(new D {}, Null, new A { name = \"a\"; id = \"some-a-value\" }).outputs.nullProp.prop1.prop2[\"foo\"].prop3; 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 }" +kInterpolation = "new reference#K { aId = Reference(new reference#D {}, String, new reference#A { name = \"a\"; id = \"some-a-value\" }).id; bId = Reference(new reference#D {}, String, new reference#B { name = \"b\"; id = \"some-b-value\" }).id; aProperties = Reference(new reference#D {}, reference#AProperties, new reference#A { name = \"a\"; id = \"some-a-value\" }).outputs; bProperties = Reference(new reference#D {}, reference#BProperties, new reference#B { name = \"b\"; id = \"some-b-value\" }).outputs; nullProp = Reference(new reference#D {}, Null, new reference#A { name = \"a\"; id = \"some-a-value\" }).outputs.nullProp.prop1.prop2[\"foo\"].prop3; aValues { Reference(new reference#D {}, Int, new reference#A { name = \"a\"; id = \"some-a-value\" }).outputs.foo; Reference(new reference#D {}, Int | Null, new reference#A { name = \"a\"; id = \"some-a-value\" }).outputs.someMapping[\"key\"]; Reference(new reference#D {}, Int, new reference#A { name = \"a\"; id = \"some-a-value\" }).outputs.someMap[new reference#MapKey { k = 123 }]; Reference(new reference#D {}, Int, new reference#A { name = \"a\"; id = \"some-a-value\" }).outputs.someListing[0]; Reference(new reference#D {}, Int, new reference#A { name = \"a\"; id = \"some-a-value\" }).outputs.someList[9223372036854775807]; Reference(new reference#D {}, Int, new reference#B { name = \"b\"; id = \"some-b-value\" }).outputs.nonString }; bValues { Reference(new reference#D {}, String, new reference#B { name = \"b\"; id = \"some-b-value\" }).outputs.foo; Reference(new reference#D {}, Null | String, new reference#B { name = \"b\"; id = \"some-b-value\" }).outputs.someMapping[\"key\"]; Reference(new reference#D {}, String, new reference#B { name = \"b\"; id = \"some-b-value\" }).outputs.someMap[new reference#MapKey { k = 123 }]; Reference(new reference#D {}, String, new reference#B { name = \"b\"; id = \"some-b-value\" }).outputs.someListing[0]; Reference(new reference#D {}, String, new reference#B { name = \"b\"; id = \"some-b-value\" }).outputs.someList[9223372036854775807]; Reference(new reference#D {}, String, new reference#A { name = \"a\"; id = \"some-a-value\" }).outputs.nonInt }; splitUnion = null }" aValuesJoined = """ ${a.outputs.foo} ${a.outputs.someMapping[key]} @@ -60,5 +60,5 @@ aValuesJoined = """ ${b.outputs.nonString} """ typeArgs = "${null.prop}" -badThisRef = "Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. Value: Reference(new D {}, reference#A, new BadResource { name = ? })" -bareFunctionType = "Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. Value: Reference(new D {}, Function4, null)" +badThisRef = "Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. Value: Reference(new reference#D {}, reference#A, new reference#BadResource { name =..." +bareFunctionType = "Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. Value: Reference(new reference#D {}, Function4, null)" diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/api/reflect4.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/api/reflect4.pcf index 94ce1d7c4..0e3b76501 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/api/reflect4.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/api/reflect4.pcf @@ -115,10 +115,10 @@ examples { ["annAOverrideB"] { name = "annAOverrideB" annotations { - "new MyAnn {}" + "new reflect4#MyAnn {}" } allAnnotations { - "new MyAnn {}" + "new reflect4#MyAnn {}" "new Unlisted {}" } modifiers {} @@ -128,10 +128,10 @@ examples { ["annAOverrideC"] { name = "annAOverrideC" annotations { - "new MyAnn {}" + "new reflect4#MyAnn {}" } allAnnotations { - "new MyAnn {}" + "new reflect4#MyAnn {}" "new Unlisted {}" } modifiers {} @@ -145,7 +145,7 @@ examples { } allAnnotations { "new AlsoKnownAs { names { \"mergedAnnotations\" } }" - "new MyAnn {}" + "new reflect4#MyAnn {}" "new Unlisted {}" } modifiers {} diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/api/xmlRendererInline3.xml b/pkl-core/src/test/files/LanguageSnippetTests/output/api/xmlRendererInline3.xml index 97c000e73..9e480a8b9 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/api/xmlRendererInline3.xml +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/api/xmlRendererInline3.xml @@ -5,5 +5,5 @@ 42 `xml.Element` is not supported here. Value: new Dynamic { _isXmlElement = true; name = "pigeon2"; attributes {}; isBlockF... - `xml.Inline` is not supported here. Value: new Inline { value { name = ?; age = ? } } + `xml.Inline` is not supported here. Value: new pkl.xml#Inline { value { name = ?; age = ? } } diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/api/yamlRendererStream2.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/api/yamlRendererStream2.pcf index 1f891c605..f80c02f7d 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/api/yamlRendererStream2.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/api/yamlRendererStream2.pcf @@ -21,6 +21,6 @@ examples { } ["invalid top level value"] { "The top-level value of a YAML stream must have type `Listing`, `List`, or `Set`, but got type `Int`. Value: 5" - "The top-level value of a YAML stream must have type `Listing`, `List`, or `Set`, but got type `yamlRendererStream2#Foo`. Value: new Foo {}" + "The top-level value of a YAML stream must have type `Listing`, `List`, or `Set`, but got type `yamlRendererStream2#Foo`. Value: new yamlRendererStream2#Foo {}" } } diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/basic/as.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/basic/as.pcf index 143873348..71feacb20 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/basic/as.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/basic/as.pcf @@ -35,8 +35,8 @@ examples { "Expected value of type `Null`, but got type `List`. Value: List(1, 2, 3)" "Expected value of type `Null`, but got type `Set`. Value: Set(1, 2, 3)" "Expected value of type `Null`, but got type `Map`. Value: Map(1, \"one\", 2, \"two\", 3, \"three\")" - "Expected value of type `Null`, but got type `as#Base`. Value: new Base {}" - "Expected value of type `Null`, but got type `as#Derived`. Value: new Derived {}" + "Expected value of type `Null`, but got type `as#Base`. Value: new as#Base {}" + "Expected value of type `Null`, but got type `as#Derived`. Value: new as#Derived {}" "Expected value of type `Null`, but got type `Mapping`. Value: new Mapping { [\"name\"] = \"Pigeon\"; [\"age\"] = 40 }" "Expected value of type `Null`, but got type `Class`. Value: as#Base" "Expected value of type `Null`, but got type `Listing`. Value: new Listing { null; null; \"Expected value of type `Null`, but got type `Strin..." @@ -59,9 +59,9 @@ examples { "Expected value of type `Int`, but got type `Map`. Value: Map(1, \"one\", 2, \"two\", 3, \"three\")" "Expected value of type `Int`, but got `null`." "Expected value of type `Int`, but got `null`." - "Expected value of type `Int`, but got type `as#Base`. Value: new Base {}" + "Expected value of type `Int`, but got type `as#Base`. Value: new as#Base {}" "Expected value of type `Int`, but got type `Function1`. Value: new Function1 {}" - "Expected value of type `Int`, but got type `as#Derived`. Value: new Derived {}" + "Expected value of type `Int`, but got type `as#Derived`. Value: new as#Derived {}" "Expected value of type `Int`, but got type `Mapping`. Value: new Mapping { [\"name\"] = \"Pigeon\"; [\"age\"] = 40 }" "Expected value of type `Int`, but got type `Class`. Value: as#Base" "Expected value of type `Int`, but got type `Listing`. Value: new Listing { 42; \"Expected value of type `Int`, but got type `String`. Value..." @@ -83,8 +83,8 @@ examples { "Expected value of type `as#Other`, but got type `Map`. Value: Map(1, \"one\", 2, \"two\", 3, \"three\")" "Expected value of type `as#Other`, but got `null`." "Expected value of type `as#Other`, but got `null`." - "Expected value of type `as#Other`, but got type `as#Base`. Value: new Base {}" - "Expected value of type `as#Other`, but got type `as#Derived`. Value: new Derived {}" + "Expected value of type `as#Other`, but got type `as#Base`. Value: new as#Base {}" + "Expected value of type `as#Other`, but got type `as#Derived`. Value: new as#Derived {}" "Expected value of type `as#Other`, but got type `Mapping`. Value: new Mapping { [\"name\"] = \"Pigeon\"; [\"age\"] = 40 }" "Expected value of type `as#Other`, but got type `Class`. Value: as#Base" "Expected value of type `as#Other`, but got type `Listing`. Value: new Listing { \"Expected value of type `as#Other`, but got type `String`. Valu..." @@ -124,7 +124,7 @@ examples { } ["derived class"] { new {} - "Expected value of type `as#Derived`, but got type `as#Base`. Value: new Base {}" + "Expected value of type `as#Derived`, but got type `as#Base`. Value: new as#Base {}" } ["Mapping"] { new { diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/basic/string.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/basic/string.pcf index ac4e7874f..9f4be1e3c 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/basic/string.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/basic/string.pcf @@ -30,7 +30,7 @@ examples { "new Listing { 1; 2; 3 }" "new Mapping { [\"Pigeon\"] = 42; [\"Barn Owl\"] = 21 }" "new Dynamic { name = \"Pigeon\"; age = 42 }" - "new Person { name = \"Pigeon\"; age = 42 }" + "new string#Person { name = \"Pigeon\"; age = 42 }" "My name is Pigeon and I'm 42 years old." "null" "null" diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints3.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints3.pcf index 221ecc6b4..3217a77f6 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints3.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints3.pcf @@ -3,4 +3,4 @@ res1 { street = "Hampton St." } } -res2 = "Type constraint `street.endsWith(\"St.\")` violated. Value: new Address { street = \"Garlic Blvd.\" }" +res2 = "Type constraint `street.endsWith(\"St.\")` violated. Value: new constraints3#Address { street = \"Garlic Blvd.\" }" diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints7.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints7.pcf index 5c38476ea..56c766ae6 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints7.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/classes/constraints7.pcf @@ -3,4 +3,4 @@ res1 { z = 12 } } -res2 = "Type constraint `multiply(subtract(add(5, 4), 3), 2) == z` violated. Value: new Y { z = 13 }" +res2 = "Type constraint `multiply(subtract(add(5, 4), 3), 2) == z` violated. Value: new constraints7#Y { z = 13 }" diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/anyConverterError.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/anyConverterError.err index ac3f423fd..f20456890 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/anyConverterError.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/anyConverterError.err @@ -6,7 +6,7 @@ xxx | renderer.renderDocument(value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ at pkl.base#Module.output.text (pkl:base) -This value was converted during rendering. Previous: new ModuleClass {}. After: "anyConverterError". +This value was converted during rendering. Previous: new anyConverterError {}. After: "anyConverterError". xxx | if (renderer is BytesRenderer) renderer.renderDocument(value) else text.encodeToBytes("UTF-8") ^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails1.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails1.err index 8e029c38f..7f3e12c41 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails1.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails1.err @@ -1,13 +1,13 @@ –– Pkl Error –– Type constraint `firstOneIsSandy` violated. -Value: new Listing { new Bird { name = "Bob" }; new Bird { name = ? } } +Value: new Listing { new constraintDetails1#Bird { name = "Bob" }; new constraintDet... (it: Listing) -> it[0].name == "Sandy" │ │ │ │ │ │ │ false │ │ "Bob" - │ new Bird { name = "Bob" } - new Listing { new Bird { name = "Bob" }; new Bird { name = ? } } + │ new constraintDetails1#Bird { name = "Bob" } + new Listing { new constraintDetails1#Bird { name = "Bob" }; new constraintDetails1#Bird { name = ... x | birds: Listing(firstOneIsSandy) = new { ^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails2.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails2.err index d2c6cba68..5660adb76 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails2.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails2.err @@ -1,18 +1,18 @@ –– Pkl Error –– Type constraint `let (myself: Listing = this) myself[0].name == "Sandy"` violated. -Value: new Listing { new Bird { name = "Bob" }; new Bird { name = ? } } +Value: new Listing { new constraintDetails2#Bird { name = "Bob" }; new constraintDet... let (myself: Listing = this) │ - new Listing { new Bird { name = "Bob" }; new Bird { name = ? } } + new Listing { new constraintDetails2#Bird { name = "Bob" }; new constraintDetails2#Bird { name = ... myself[0].name == "Sandy" │ │ │ │ │ │ │ false │ │ "Bob" - │ new Bird { name = "Bob" } - new Listing { new Bird { name = "Bob" }; new Bird { name = ? } } + │ new constraintDetails2#Bird { name = "Bob" } + new Listing { new constraintDetails2#Bird { name = "Bob" }; new constraintDetails2#Bird { name = ... x | let (myself: Listing = this) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails3.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails3.err index f847d7deb..8934351c9 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails3.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/constraintDetails3.err @@ -1,11 +1,11 @@ –– Pkl Error –– Type constraint `toList().every((it: Listing) -> it[0].name == "Bob")` violated. -Value: new Listing { new Listing { new Bird { name = "Eagle" }; new Bird { name = ? ... +Value: new Listing { new Listing { new constraintDetails3#Bird { name = "Eagle" }; n... toList().every((it: Listing) -> it[0].name == "Bob") │ │ │ false - List(new Listing { new Bird { name = "Eagle" }; new Bird { name = ? } }) + List(new Listing { new constraintDetails3#Bird { name = "Eagle" }; new constraintDetails3#Bird { ... x | foo: Listing(toList().every((it: Listing) -> it[0].name == "Bob")) = new { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/forGeneratorCannotIterateOverTyped.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/forGeneratorCannotIterateOverTyped.err index a29c0e47e..2ee7b325e 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/forGeneratorCannotIterateOverTyped.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/forGeneratorCannotIterateOverTyped.err @@ -1,6 +1,6 @@ –– Pkl Error –– Cannot iterate over value of type `forGeneratorCannotIterateOverTyped#Person`. -Value: new Person {} +Value: new forGeneratorCannotIterateOverTyped#Person {} x | for (_ in new Person {}) { 42 } ^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/listingTypeCheckError9.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/listingTypeCheckError9.err index 34e06cbda..2444aa443 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/listingTypeCheckError9.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/listingTypeCheckError9.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `listingTypeCheckError9#Bar`, but got type `listingTypeCheckError9#Foo`. -Value: new Foo {} +Value: new listingTypeCheckError9#Foo {} x | local c = b as Listing ^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/mappingTypeCheckError11.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/mappingTypeCheckError11.err index b53aa426e..12131c7ae 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/mappingTypeCheckError11.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/mappingTypeCheckError11.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `mappingTypeCheckError11#Bar`, but got type `mappingTypeCheckError11#Foo`. -Value: new Foo {} +Value: new mappingTypeCheckError11#Foo {} x | local c = b as Mapping ^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/power/typeConstraints16.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/power/typeConstraints16.err index d4561099a..3614b0300 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/power/typeConstraints16.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/power/typeConstraints16.err @@ -1,6 +1,6 @@ –– Pkl Error –– Type constraint `name?.contains("Bob") ?? false` violated. -Value: new Bird { name = "Pigeon" } +Value: new typeConstraints16#Bird { name = "Pigeon" } name?.contains("Bob") ?? false │ │ │ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/power/typeConstraints2.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/power/typeConstraints2.err index 699fd7afc..6327f2bda 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/power/typeConstraints2.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/power/typeConstraints2.err @@ -5,7 +5,7 @@ Value: "Huzzah" startsWith(bub.name) │ │ │ false │ "Bub" - new Person { name = "Bub" } + new typeConstraints2#Person { name = "Bub" } x | foo: String(startsWith(bub.name)) = "Huzzah" ^^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference1.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference1.err index ebc5ea327..fd4c06932 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference1.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference1.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. -Value: Reference(new D {}, String, "") +Value: Reference(new reference1#D {}, String, "") x | typealias Ref = ref.Reference ^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference19.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference19.err index cafd2a0e0..057797809 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference19.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference19.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. -Value: Reference(new D {}, Boolean | Int | String, "").foo +Value: Reference(new reference19#D {}, Boolean | Int | String, "").foo xx | test = ref.Reference(d, A, "").foo as ref.Reference ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference2.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference2.err index ce1a58dbc..33f801e09 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference2.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference2.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. -Value: Reference(new D {}, String, "") +Value: Reference(new reference2#D {}, String, "") x | typealias Ref = ref.Reference ^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference25.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference25.err index 8cf2422d1..dc5e60341 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference25.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference25.err @@ -1,6 +1,6 @@ –– Pkl Error –– Operator `[]` is not defined for operand types `pkl.ref#Reference>` and `Int`. -Left operand : Reference(new D {}, Duration | Listing, null).$ +Left operand : Reference(new reference25#D {}, Duration | Listing, null).$ Right operand: 0 xx | res = myRef[0] diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference3.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference3.err index 7151afaa7..07b83ce15 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference3.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference3.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `pkl.ref#Reference>`, but got type `pkl.ref#Reference`. -Value: Reference(new D {}, String, "") +Value: Reference(new reference3#D {}, String, "") x | typealias Ref = ref.Reference ^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference4.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference4.err index 46c6a8e2c..17d330e48 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference4.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference4.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. -Value: Reference(new D {}, String, "") +Value: Reference(new reference4#D {}, String, "") x | typealias Ref = ref.Reference ^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference5.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference5.err index 3749aa331..a6997b04c 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference5.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference5.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `pkl.ref#Reference`, but got type `pkl.ref#Reference`. -Value: Reference(new D2 {}, String, "") +Value: Reference(new reference5#D2 {}, String, "") x | typealias Ref = ref.Reference ^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference7.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference7.err index 93f5f8ebb..b3bd5e6f7 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference7.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/reference7.err @@ -1,6 +1,6 @@ –– Pkl Error –– Operator `[]` is not defined for operand types `pkl.ref#Reference` and `String`. -Left operand : Reference(new D {}, List, List()) +Left operand : Reference(new reference7#D {}, List, List()) Right operand: "hi" x | test = ref.Reference(d, List, List())["hi"] diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/spreadSyntaxCannotIterateOverTyped.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/spreadSyntaxCannotIterateOverTyped.err index 1416f8f8e..1540d0ac6 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/spreadSyntaxCannotIterateOverTyped.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/spreadSyntaxCannotIterateOverTyped.err @@ -1,6 +1,6 @@ –– Pkl Error –– Cannot iterate over value of type `spreadSyntaxCannotIterateOverTyped#Person`. -Value: new Person { name = ? } +Value: new spreadSyntaxCannotIterateOverTyped#Person { name = ? } x | ...person ^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/undefinedProperty3.err b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/undefinedProperty3.err index af3ce2c2c..34b9cf996 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/errors/undefinedProperty3.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/errors/undefinedProperty3.err @@ -5,7 +5,7 @@ xx | theNumber : Int ^^^^^^^^^ at undefinedProperty3#C.theNumber (file:///$snippetsDir/input/errors/undefinedProperty3.pkl) -The above error occurred when rendering path `a.b[new D { dProperty = "dProperty" }].`bar-baz`.theNumber` of module `file:///$snippetsDir/input/errors/undefinedProperty3.pkl`. +The above error occurred when rendering path `a.b[new undefinedProperty3#D { dProperty = "dProperty" }].`bar-baz`.theNumber` of module `file:///$snippetsDir/input/errors/undefinedProperty3.pkl`. xxx | renderer.renderDocument(value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/lambdas/amendLambdaParametersTyped.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/lambdas/amendLambdaParametersTyped.pcf index cf48e5b36..b7802730e 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/lambdas/amendLambdaParametersTyped.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/lambdas/amendLambdaParametersTyped.pcf @@ -22,5 +22,5 @@ example5 { } } example6 { - result = "Expected value of type `amendLambdaParametersTyped#Baz`, but got type `amendLambdaParametersTyped#Foo`. Value: new Foo {}" + result = "Expected value of type `amendLambdaParametersTyped#Baz`, but got type `amendLambdaParametersTyped#Foo`. Value: new amendLambdaParametersTyped#Foo {}" } diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/lambdas/pipeOperator.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/lambdas/pipeOperator.pcf index 3be0077b4..bf0ce4481 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/lambdas/pipeOperator.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/lambdas/pipeOperator.pcf @@ -8,4 +8,4 @@ res7 = 22 res8 = 44 res9 = 44 res10 = "Operator `|>` is not defined for operand types `Int` and `Int`. Left operand : 42 Right operand: 21" -res11 = "Operator `|>` is not defined for operand types `Int` and `pipeOperator#Person`. Left operand : 42 Right operand: new Person {}" +res11 = "Operator `|>` is not defined for operand types `Int` and `pipeOperator#Person`. Left operand : 42 Right operand: new pipeOperator#Person {}" diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/mappings2/wrongParent.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/mappings2/wrongParent.pcf index 4451e1d4c..ab2a23aa9 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/mappings2/wrongParent.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/mappings2/wrongParent.pcf @@ -1,12 +1,12 @@ res1 = "Cannot instantiate, or amend an instance of, external class `Int`." res2 = "Cannot instantiate, or amend an instance of, external class `List`." res3 = "Cannot instantiate, or amend an instance of, external class `List`." -res4 = "Object of type `new Person {}` cannot have an entry." +res4 = "Object of type `new wrongParent#Person {}` cannot have an entry." res5 = "Cannot instantiate abstract class `ValueRenderer`." res6 = "Element index `0` is out of range `0`..`-1`." res7 = "Cannot instantiate, or amend an instance of, external class `Int`." res8 = "Cannot instantiate, or amend an instance of, external class `List`." res9 = "Cannot instantiate, or amend an instance of, external class `List`." -res10 = "Object of type `new Person {}` cannot have an entry." +res10 = "Object of type `new wrongParent#Person {}` cannot have an entry." res11 = "Cannot instantiate abstract class `ValueRenderer`." res12 = "Element index `0` is out of range `0`..`-1`." diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badPklProject5/bug.err b/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badPklProject5/bug.err index 35d10ef20..ec8e2e6e6 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badPklProject5/bug.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badPklProject5/bug.err @@ -1,6 +1,6 @@ –– Pkl Error –– Type constraint `(externalModuleReaders != null).implies(isFileBasedProject)` violated. -Value: new ModuleClass { externalProperties = ?; env = ?; allowedModules = ?; allowe... +Value: new pkl.EvaluatorSettings { externalProperties = ?; env = ?; allowedModules =... (externalModuleReaders != null).implies(isFileBasedProject) │ │ │ │ diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps4/bug.err b/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps4/bug.err index d29b1584d..b6e6b9444 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps4/bug.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/projects/badProjectDeps4/bug.err @@ -1,6 +1,6 @@ –– Pkl Error –– Expected value of type `*RemoteDependency | Project(isValidLoadDependency)`, but got a different `pkl.Project`. -Value: new ModuleClass { package = ?; tests = ?; dependencies { ["badLocalProject"] ... +Value: new pkl.Project { package = ?; tests = ?; dependencies { ["badLocalProject"] ... xxx | dependencies: Mapping ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,26 +8,26 @@ at pkl.Project#dependencies (pkl:Project) * Value is not of type `Project(isValidLoadDependency)` because: Type constraint `isValidLoadDependency` violated. - Value: new ModuleClass { package = ?; tests = ?; dependencies { ["badLocalProject"... + Value: new pkl.Project { package = ?; tests = ?; dependencies { ["badLocalProject"... (it: Project) -> isUriLocal(projectFileUri, it.projectFileUri) │ │ │ │ true │ │ "file:///$snippetsDir/projects/badProjectDeps4/PklProject" - │ new ModuleClass { package = ?; tests = ?; dependencies { ["badLocalProject"] = ? }; evaluatorSett... + │ new pkl.Project { package = ?; tests = ?; dependencies { ["badLocalProject"] = ? }; evaluatorSett... "file:///$snippetsDir/projects/badProjectDeps4/PklProject" && it.projectFileUri.endsWith("/PklProject") │ │ │ │ │ │ │ true │ │ "file:///$snippetsDir/projects/badProjectDeps4/PklProject" - │ new ModuleClass { package = ?; tests = ?; dependencies { ["badLocalProject"] = ? }; evaluatorSett... + │ new pkl.Project { package = ?; tests = ?; dependencies { ["badLocalProject"] = ? }; evaluatorSett... true && it != module │ │ │ │ │ false - │ new ModuleClass { package = ?; tests = ?; dependencies { ["badLocalProject"] = ? }; evaluatorSett... + │ new pkl.Project { package = ?; tests = ?; dependencies { ["badLocalProject"] = ? }; evaluatorSett... false && it.package != null diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/types/currentModuleType6.err b/pkl-core/src/test/files/LanguageSnippetTests/output/types/currentModuleType6.err index c7fd6bed2..f5b61bdf0 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/types/currentModuleType6.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/types/currentModuleType6.err @@ -15,5 +15,5 @@ res3 { modName = "currentModuleType6#ModuleSubclass" mod2x = -1 } -res4 = "Expected value of type `currentModuleType6#ModuleSubclass`, but got type `moduleTypeProperty`. Value: new ModuleClass { x = ?; y = ?; modName = ? }" +res4 = "Expected value of type `currentModuleType6#ModuleSubclass`, but got type `moduleTypeProperty`. Value: new moduleTypeProperty { x = ?; y = ?; modName = ? }" pkl: WARN: Cannot reference `module` type within a class body. This will be an error in a future release. (file:///$snippetsDir/input/types/currentModuleType6.pkl) diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/types/thisType1.pcf b/pkl-core/src/test/files/LanguageSnippetTests/output/types/thisType1.pcf index 8144e6f08..0582fae1f 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/types/thisType1.pcf +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/types/thisType1.pcf @@ -5,22 +5,22 @@ res1d = 2 res1e = 4 res4 = null res7 = "Expected value of type `thisType1#Bad`, but got type `String`. Value: \"abc\"" -res8 = "Expected value of type `thisType1#Bad`, but got type `thisType1#Person`. Value: new Person {}" -res9 = "Expected value of type `thisType1#Bad`, but got type `thisType1#Person`. Value: new Person {}" -res10 = "Expected value of type `thisType1#Bad`, but got type `thisType1#Person`. Value: new Person {}" +res8 = "Expected value of type `thisType1#Bad`, but got type `thisType1#Person`. Value: new thisType1#Person {}" +res9 = "Expected value of type `thisType1#Bad`, but got type `thisType1#Person`. Value: new thisType1#Person {}" +res10 = "Expected value of type `thisType1#Bad`, but got type `thisType1#Person`. Value: new thisType1#Person {}" res11a = 2 res11b = 3 res11c = 4 res11d = 4 -res12 = "Expected value of type `thisType1#Good`, but got type `thisType1`. Value: new ModuleClass { res1a = 1; res1b = 2; res1c = 3; res1d = 2; res1e = 4; res4..." +res12 = "Expected value of type `thisType1#Good`, but got type `thisType1`. Value: new thisType1 { res1a = 1; res1b = 2; res1c = 3; res1d = 2; res1e = 4; res4 =..." res13a = 1 res14 = List(3) -res14a = "Expected value of type `thisType1#Good`, but got type `thisType1`. Value: new ModuleClass { res1a = 1; res1b = 2; res1c = 3; res1d = 2; res1e = 4; res4..." +res14a = "Expected value of type `thisType1#Good`, but got type `thisType1`. Value: new thisType1 { res1a = 1; res1b = 2; res1c = 3; res1d = 2; res1e = 4; res4 =..." res14b = 5 res15 = List(new { x = 3 }) -res15a = "Expected value of type `thisType1#B`, but got type `thisType1#A`. Value: new A { x = 1 }" +res15a = "Expected value of type `thisType1#B`, but got type `thisType1#A`. Value: new thisType1#A { x = 1 }" res15b = List(new { x = 3 }) diff --git a/pkl-core/src/test/files/LanguageSnippetTests/output/types/typeAlias6.err b/pkl-core/src/test/files/LanguageSnippetTests/output/types/typeAlias6.err index 15e7ebd20..7cbec714c 100644 --- a/pkl-core/src/test/files/LanguageSnippetTests/output/types/typeAlias6.err +++ b/pkl-core/src/test/files/LanguageSnippetTests/output/types/typeAlias6.err @@ -1,7 +1,7 @@ pkl: WARN: Cannot reference `module` type within a type alias body. This will be an error in a future release. (file:///$snippetsDir/input-helper/types/typeAliasModule.pkl) –– Pkl Error –– Expected value of type `typeAliasModule`, but got type `typeAlias6`. -Value: new ModuleClass { res = ? } +Value: new typeAlias6 { res = ? } x | res: typeAliasModule = module ^^^^^^^^^^^^^^^