[PR #516] [MERGED] Require references from typealiases to be const #598

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

📋 Pull Request Information

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

Base: mainHead: typealias-const


📝 Commits (1)

  • cdbf867 Require references from typealiases to be const

📊 Changes

5 files changed (+37 additions, -7 deletions)

View changed files

📝 docs/modules/language-reference/pages/index.adoc (+12 -5)
📝 pkl-core/src/main/java/org/pkl/core/ast/builder/SymbolTable.java (+1 -1)
pkl-core/src/test/files/LanguageSnippetTests/input/errors/const/constTypeAliasConstraint.pkl (+5 -0)
pkl-core/src/test/files/LanguageSnippetTests/output/errors/const/constTypeAliasConstraint.err (+18 -0)
📝 stdlib/Project.pkl (+1 -1)

📄 Description

This adds a language change that requires references from typealiases to the enclosing module to be const.

This is required because typealiases are not late-bound.

Rationale is laid out in SPICE-0007.

Also:

  • Update documentation to reflect new rules.
  • Fix Project.pkl; mark method const to not break said rule.

🔄 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/516 **Author:** [@bioball](https://github.com/bioball) **Created:** 6/5/2024 **Status:** ✅ Merged **Merged:** 6/10/2024 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `typealias-const` --- ### 📝 Commits (1) - [`cdbf867`](https://github.com/apple/pkl/commit/cdbf86714ee7e9dec35ab75772f7dd306c02ed9b) Require references from typealiases to be const ### 📊 Changes **5 files changed** (+37 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `docs/modules/language-reference/pages/index.adoc` (+12 -5) 📝 `pkl-core/src/main/java/org/pkl/core/ast/builder/SymbolTable.java` (+1 -1) ➕ `pkl-core/src/test/files/LanguageSnippetTests/input/errors/const/constTypeAliasConstraint.pkl` (+5 -0) ➕ `pkl-core/src/test/files/LanguageSnippetTests/output/errors/const/constTypeAliasConstraint.err` (+18 -0) 📝 `stdlib/Project.pkl` (+1 -1) </details> ### 📄 Description This adds a language change that requires references from typealiases to the enclosing module to be `const`. This is required because typealiases are not late-bound. Rationale is laid out in [SPICE-0007](https://github.com/apple/pkl-evolution/pull/8). Also: * Update documentation to reflect new rules. * Fix `Project.pkl`; mark method `const` to not break said rule. --- <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:25:34 +01:00
adam closed this issue 2025-12-30 01:25:34 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#598