Skip to content

Support for extension type declarations #82

@parlough

Description

@parlough

The bodies of extension types seem to be handled gracefully, but the declaration isn't handled fully. They also support a limited version of the in-discussion primary constructor support.

Language docs: https://dart.dev/language/extension-types
Feature specification: https://github.com/dart-lang/language/blob/main/accepted/3.3/extension-types/feature-specification.md
Grammar:

<extensionTypeDeclaration> ::=
  'extension' 'type' 'const'? <typeIdentifier> <typeParameters>?
  <representationDeclaration> <interfaces>?
  '{'
    (<metadata> <extensionTypeMemberDeclaration>)*
  '}'

<representationDeclaration> ::=
  ('.' <identifierOrNew>)? '(' <metadata> <type> <identifier> ')'

<identifierOrNew> ::= <identifier> | 'new'

<extensionTypeMemberDeclaration> ::= <classMemberDefinition>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions