feat: Add support for extension types, class type aliases and class modifiers#19
Merged
Conversation
wolfenrain
approved these changes
Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for several modern Dart language features that the extractor did not handle. Previously, extension types and class type aliases would throw an
AssertionError(Unknown declaration type: ...), and the Dart 3 class modifiers were silently dropped.Extension types
extension type Meters(int value) implements num {}is now serialized with a new"extension-type"kind, including its representation declaration,constmodifier,implementsclause, type parameters and members:{ "kind": "extension-type", "name": "Meters", "representation": {"name": "value", "type": "int"}, "implements": ["num"] }Class type aliases
class C = B with M implements I;(ClassTypeAlias) is now serialized as a"class"declaration with itsextends/with/implementsclauses and modifiers.Class modifiers
The Dart 3
base,interface,final,sealedandmixin classmodifiers are now reported as boolean fields on class declarations (andbaseon mixins), alongside the existingabstractfield.Notes
ExtensionTypeDeclarationandRepresentationDeclarationAST nodes are still flagged@experimentalby the analyzer even though extension types have been stable since Dart 3.3, so a scopedexperimental_member_useignore is used.CHANGELOG.mdentry are left for a separate release PR.Testing
dart format .dart analyze --fatal-warnings --fatal-infosdart test(81 tests passing, up from 69)