You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I played around with Pkl. Now I tried to generate swift code from it, but it failed. I got following error message
$ ./pkl-gen-swift-macos.bin --version
0.3.0
$ ./pkl-gen-swift-macos.bin -o test tuclib/Timer1.pkl
Error: PklError(message: "–– Pkl Error ––\nCannot generate type Version as Swift.\n\n70 | else throw(\"Cannot generate type \\(type.referent.name) as Swift.\")\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nat pkl.swift.internal.typegen#generateDeclaredType.<function#3> (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/typegen.pkl#L70-L70)\n\n64 | let (mapped = seenMappings.findOrNull((it) -> it.source == referent))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nat pkl.swift.internal.typegen#generateDeclaredType.<function#2> (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/typegen.pkl#L64-L70)\n\n63 | let (reflectee = type.referent.reflectee)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nat pkl.swift.internal.typegen#generateDeclaredType.<function#1> (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/typegen.pkl#L63-L70)\n\n62 | let (referent = type.referent)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nat pkl.swift.internal.typegen#generateDeclaredType (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/typegen.pkl#L62-L70)\n\n30 | generateDeclaredType(type, enclosing, seenMappings)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nat pkl.swift.internal.typegen#generateType (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/typegen.pkl#L30-L30)\n\n121 | type = typegen.generateType(prop.type, clazz, mappings)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nat pkl.swift.internal.ClassGen#getProperties.<function#7>.type (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/ClassGen.pkl#L121-L121)\n\n369 | isPolymorphic: Boolean = type.isPolymorphic\n ^^^^\nat pkl.swift.internal.ClassGen#Property.isPolymorphic (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/ClassGen.pkl#L369-L369)\n\n162 | when (properties.values.any((p) -> p.isPolymorphic)) {\n ^^^^^^^^^^^^^^^\nat pkl.swift.internal.ClassGen#struct.<function#2> (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/ClassGen.pkl#L162-L162)\n\n162 | when (properties.values.any((p) -> p.isPolymorphic)) {\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nat pkl.swift.internal.ClassGen#struct (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/ClassGen.pkl#L162-L162)\n\n43 | struct\n ^^^^^^\nat pkl.swift.internal.ClassGen#contents[#3] (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/ClassGen.pkl#L43-L43)\n\n35 | contents = new Listing {\n ^^^^^^^^^^^^^\nat pkl.swift.internal.ClassGen#contents (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/ClassGen.pkl#L35-L45)\n\n151 | text = contents\n ^^^^^^^^\nat pkl.swift.internal.SwiftNamespace#output.files[#1].text (https://github.com/apple/pkl-swift/blob/0.3.0/codegen/src/internal/SwiftNamespace.pkl#L151-L151)\n\n1 | output.files.toMap().mapValues((_, it) -> it.text)\n ^^^^^^^\nat repl:text.<function#1> (repl:text)\n\n1 | output.files.toMap().mapValues((_, it) -> it.text)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nat (repl:text)\n")
Looks like something went wrong when printing the error: It's just one line and it's looks like the error code print commandos are logged and not the error message itself.
Way to reproduce: Create a test.pkl file with following content
import "pkl:semver"
version: semver.Version
and then run ./pkl-gen-swift-macos.bin -o test test.pkl
The text was updated successfully, but these errors were encountered:
I played around with Pkl. Now I tried to generate swift code from it, but it failed. I got following error message
Looks like something went wrong when printing the error: It's just one line and it's looks like the error code print commandos are logged and not the error message itself.
Way to reproduce: Create a test.pkl file with following content
and then run
./pkl-gen-swift-macos.bin -o test test.pkl
The text was updated successfully, but these errors were encountered: