Skip to content

Add import destructuring and amends/extends of classes within modules#1461

Draft
HT154 wants to merge 2 commits intoapple:mainfrom
HT154:import-destructuring
Draft

Add import destructuring and amends/extends of classes within modules#1461
HT154 wants to merge 2 commits intoapple:mainfrom
HT154:import-destructuring

Conversation

@HT154
Copy link
Contributor

@HT154 HT154 commented Mar 3, 2026

Destructuring import clauses

Only supports types and properties. Methods are not supported.

Usage

// module members may be aliased as well
import "foo.pkl" as { bar, baz as qux }
// module itself may be imported with an alias, which must come first
import "foo.pkl" as myFoo, { bar, baz as qux }

amends/extends module members

Usage

extends Foo in "bar.pkl"
amends Foo in "bar.pkl"

Class and property members may be amended

Note

Non-module classes do not have an output: ModuleOutput property and thus modules extending/amending them cannot be evaluated directly using the CLI. Such modules may still be imported and used by other modules.

Closes #966

@HT154 HT154 force-pushed the import-destructuring branch from b3baf81 to 093f071 Compare March 5, 2026 01:38
@HT154 HT154 force-pushed the import-destructuring branch from 093f071 to 3cbd6ff Compare March 6, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Import deconstruction (& aliasing/macros)

1 participant