mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
[PR #752] [MERGED] Eagerly check listing/mapping in iterables #713
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/752
Author: @bioball
Created: 10/30/2024
Status: ✅ Merged
Merged: 10/31/2024
Merged by: @bioball
Base:
main← Head:eager-check-iterables📝 Commits (7)
c2f7879Minimize for-generator scoping buga232865Use modifier to flag whether in iterable2020c7aApply suggestions from code review3e00f3fAdd isInIterable to Memberaa38373Cleanup48dd09dRun spotless apply76d0c70Don't consider spread members as in iterable📊 Changes
10 files changed (+126 additions, -11 deletions)
View changed files
📝
pkl-core/src/main/java/org/pkl/core/ast/VmModifier.java(+7 -0)📝
pkl-core/src/main/java/org/pkl/core/ast/builder/AstBuilder.java(+24 -8)📝
pkl-core/src/main/java/org/pkl/core/ast/builder/SymbolTable.java(+10 -0)📝
pkl-core/src/main/java/org/pkl/core/ast/member/Member.java(+17 -0)📝
pkl-core/src/main/java/org/pkl/core/ast/member/ObjectMember.java(+1 -0)📝
pkl-core/src/main/java/org/pkl/core/ast/member/PropertyTypeNode.java(+16 -0)📝
pkl-core/src/main/java/org/pkl/core/ast/member/TypeCheckedPropertyNode.java(+4 -2)📝
pkl-core/src/main/java/org/pkl/core/ast/member/TypedPropertyNode.java(+4 -1)➕
pkl-core/src/test/files/LanguageSnippetTests/input/generators/forGeneratorNestedReference.pkl(+33 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/output/generators/forGeneratorNestedReference.pcf(+10 -0)📄 Description
When we introduced lazy listing/mapping typechecking, we widened an existing bug around resolving for-generator variables in https://github.com/apple/pkl/issues/741.
To prevent this bug from being widened, this introduces logic to eagerly evaluate any
Listing<V>orMapping<K, V>found in the iterable.We're not sure what the best approach is yet to fix the bug. In the meantime, this prevents the existing bug from being any more prevalent than it currently is.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.