Skip to content

[Class Modifiers] Specification of Disallowing Implementation seems unnecessarily complex #2910

Closed
@leafpetersen

Description

@leafpetersen

The section on disallowing implementation in the class modifiers spec is quite hard to read, and I think unnecessarily so. As best I can tell, it is entirely equivalent to the following two sentence specification:

It is a compile-time error to implement an interface I in library L unless all super-interfaces of I (including I) which are marked `base` or `final` are also defined in L.

It is a compile-time error if a sub-interface of a declaration marked `base` or `final` is not marked `base`, `final`, or `sealed`.

Am I missing something? This seems much clearer and easier to understand. It might be reasonable to present the "cannot be implemented locally" algorithm as commentary on a possible implementation, but as best I can tell it is equivalent, and seems much harder to reason through.

cc @dart-lang/language-team

Metadata

Metadata

Assignees

No one assigned

    Labels

    class-modifiersIssues related to "base", "final", "interface", and "mixin" modifiers on classes and mixins.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions