Skip to content

Amending into a Mapping inside a class #652

Closed Answered by bioball
fhalde asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't dug into this, but, it's probably because of these lines: https://github.com/apple/pkl-pantry/blob/b7d8b68eb980d3cb6f6babb16537580425419fd6/packages/pkl.experimental.deepToTyped/deepToTyped.pkl#L129-L132

properties: Mapping<String, String>? is sugar for: properties: Mapping<String, String>? = Null(new Mapping<String, String> {})

Null(new Mapping<String, String> {}) is a different null than the null literal; they behave differently when amended.

This is probably a bug in deepToTyped, feel free to create a GitHub issue for it (or submit a PR to fix it)

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@fhalde
Comment options

Answer selected by fhalde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants