[PR #725] [MERGED] Fix typecheck error on Listing/Mapping #694

Closed
opened 2025-12-30 01:26:12 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/725
Author: @bioball
Created: 10/23/2024
Status: Merged
Merged: 10/23/2024
Merged by: @bioball

Base: mainHead: fix-type-check-error


📝 Commits (2)

  • 508aea1 Fix typecheck error on Listing/Mapping
  • f25b9dc Add another test case

📊 Changes

9 files changed (+85 additions, -0 deletions)

View changed files

📝 pkl-core/src/main/java/org/pkl/core/runtime/VmUtils.java (+3 -0)
pkl-core/src/test/files/LanguageSnippetTests/input/errors/listingTypeCheckError6.pkl (+5 -0)
pkl-core/src/test/files/LanguageSnippetTests/input/errors/listingTypeCheckError7.pkl (+2 -0)
pkl-core/src/test/files/LanguageSnippetTests/input/errors/mappingTypeCheckError10.pkl (+2 -0)
pkl-core/src/test/files/LanguageSnippetTests/input/errors/mappingTypeCheckError9.pkl (+5 -0)
pkl-core/src/test/files/LanguageSnippetTests/output/errors/listingTypeCheckError6.err (+19 -0)
pkl-core/src/test/files/LanguageSnippetTests/output/errors/listingTypeCheckError7.err (+15 -0)
pkl-core/src/test/files/LanguageSnippetTests/output/errors/mappingTypeCheckError10.err (+15 -0)
pkl-core/src/test/files/LanguageSnippetTests/output/errors/mappingTypeCheckError9.err (+19 -0)

📄 Description

The addresses the following case:

local l1: Listing<String> = new { 1 }
l2: Listing<Int> = (l1) { 2 }

The member in l1 should be checked against its owner; to check against Listing<String>.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/725 **Author:** [@bioball](https://github.com/bioball) **Created:** 10/23/2024 **Status:** ✅ Merged **Merged:** 10/23/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `fix-type-check-error` --- ### 📝 Commits (2) - [`508aea1`](https://github.com/apple/pkl/commit/508aea164d071aa696ab93c152b4ba9e0aefb654) Fix typecheck error on Listing/Mapping - [`f25b9dc`](https://github.com/apple/pkl/commit/f25b9dcbdf89a2323d0f4ae27c2bacd6a00b2013) Add another test case ### 📊 Changes **9 files changed** (+85 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `pkl-core/src/main/java/org/pkl/core/runtime/VmUtils.java` (+3 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/input/errors/listingTypeCheckError6.pkl` (+5 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/input/errors/listingTypeCheckError7.pkl` (+2 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/input/errors/mappingTypeCheckError10.pkl` (+2 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/input/errors/mappingTypeCheckError9.pkl` (+5 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/output/errors/listingTypeCheckError6.err` (+19 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/output/errors/listingTypeCheckError7.err` (+15 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/output/errors/mappingTypeCheckError10.err` (+15 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/output/errors/mappingTypeCheckError9.err` (+19 -0) </details> ### 📄 Description The addresses the following case: ``` local l1: Listing<String> = new { 1 } l2: Listing<Int> = (l1) { 2 } ``` The member in `l1` should be checked against its owner; to check against `Listing<String>`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:26:12 +01:00
adam closed this issue 2025-12-30 01:26:12 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#694