-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
With the new multi-target references (#1509), references in your language can now target multiple elements at once:
interface Obj {
A: number
}
interface Obj {
B: string
}
// `Obj` is a reference to both interfaces (not only one of them)
// Our type system should merge those definitions
const x: Obj = {
A: 123,
B: "hello world"
}There are a lot of existing programming languages out there that provide features like interface merging or partial classes, which allow you to target multiple AST elements with one reference.
This feature is now available in the grammar language via the [+ReferenceType] syntax:
Item: name=ID;
ReferenceElement: item=[+Item]; // Can reference multiple `Item` elements with the same name
This will generate a item: MultiReference<Item> field now.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation