mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 14:20:35 +01:00
[PR #1369] Add error hint when accessing the default value of a union type with no default #1051
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1369
Author: @HT154
Created: 12/14/2025
Status: 🔄 Open
Base:
main← Head:amend-union-no-default-hint📝 Commits (3)
43e9f2eAdd error hint when accessing the default value of a union type with no default7c1aedeHandle unions with default element but still no default value5bb88d3Update error message📊 Changes
11 files changed (+121 additions, -4 deletions)
View changed files
📝
pkl-core/src/main/java/org/pkl/core/ast/member/DefaultPropertyBodyNode.java(+27 -2)📝
pkl-core/src/main/java/org/pkl/core/ast/type/TypeNode.java(+8 -0)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmExceptionBuilder.java(+12 -2)📝
pkl-core/src/main/resources/org/pkl/core/errorMessages.properties(+10 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/errors/noDefault3.pkl(+3 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/errors/noDefault4.pkl(+4 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/errors/noDefault5.pkl(+3 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/output/errors/noDefault2.err(+2 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/output/errors/noDefault3.err(+18 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/output/errors/noDefault4.err(+18 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/output/errors/noDefault5.err(+16 -0)📄 Description
Resolves #1368
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.