mirror of
https://github.com/apple/pkl.git
synced 2026-01-13 23:23:37 +01:00
[PR #144] [MERGED] Fix name resolution in typealias with constraint
#426
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/144
Author: @KushalP
Created: 2/13/2024
Status: ✅ Merged
Merged: 2/15/2024
Merged by: @bioball
Base:
main← Head:fix-name-resolution-typealias-with-constraint📝 Commits (1)
bbcb5cfFix name resolution intypealiaswith constraint📊 Changes
11 files changed (+76 additions, -7 deletions)
View changed files
📝
pkl-core/src/main/java/org/pkl/core/ast/member/TypeAliasNode.java(+2 -1)📝
pkl-core/src/main/java/org/pkl/core/ast/type/TypeNode.java(+23 -0)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmTypeAlias.java(+10 -1)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmUtils.java(+8 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input-helper/types/typeAliasConstraint2.pkl(+3 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/types/typeAliasConstraint1.pkl(+12 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/input/types/typeAliasConstraint2.pkl(+8 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/output/api/string.pcf(+4 -4)➕
pkl-core/src/test/files/LanguageSnippetTests/output/types/typeAliasConstraint1.pcf(+2 -0)➕
pkl-core/src/test/files/LanguageSnippetTests/output/types/typeAliasConstraint2.pcf(+3 -0)📝
stdlib/base.pkl(+1 -1)📄 Description
The body of a
typealiasgets inlined into wherever thetypealiasis used. This fixes a bug where the name resolution would resolve an additional type constraint on the next scope ofthis.Lack of a frame scope
typealiasdoesn't currently have a frame scope, which is why we have to assign theownerand thereceiverhere. If it did, we could read both of these at the point where we're trying to resolve thetypealiasin question.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.