Skip to content

Augmentation ordering dependence with "with" and "implements" #4337

@munificent

Description

@munificent

I'm working on simplifying augmentations now that we don't need to support full macro generality.

My recollection from a previous language meeting is that we want eliminate augmented and allowing an augmentation to wrap existing code. The goal is to make it so that an introductory declaration and all of its augmentations form a non-overlapping union of disjoint declarations. That way, we don't have to define any sort of augmentation application order.

Disallowing an augmentation from replacing/wrapping an existing (non-"augmentation abstract") member covers much of this.

But augmentations are also allowed to append to a type declaration's with and implements clauses. I'm not sure if the order of types in an implements clause is user-visible, but the order of mixins in a with clause certainly is if they happen to override the same instance member.

Any thoughts on how we should handle this in augmentations? We do know that some code generators have use cases for adding to the implements and with clauses, so disallowing augmentations from touching those entirely is probably too restrictive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    augmentationsIssues related to the augmentations proposal.questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions