Closed
1 of 1 issue completedDescription
This meta issue tracks all the analyzer implementation work items. Referenced from: https://github.com/dart-lang/sdk/blob/main/pkg/analyzer/doc/process/new_language_feature.md
Estimated work
-
Parser
- Need changes to identify when we have a shorthand, add all selectors
- Recovery/error when . followed by a keyword?, some random symbol
- Expressions can’t start with .
-
AST enhancements (AstBuilder)
- New AST type to represent the enum shorthand
- . operator
- And then the rest of the expression
- Based on Paul’s prototype we need to represent a non-existent target (which he does with a “MAGIC” SimpleIdentifier)
-
Summary support
- Summaries record constants so I might need to do work here? Check with Konstantin
-
Resolution
- ResolverVisitor (type-based resolution)
- Paul’s prototype used a stack of type schemas (named _enumShorthands). “When the ResolverVisitor enters the enum shorthand context node, it pushes the context onto this stack; when it leaves it, it pops it back off”
- Work needed, tests needed.
- == work in the TypeAnalyzer as well.
- ResolverVisitor (type-based resolution)
-
Constant evaluation
- We allow consts for enum shorthands.
- Use the new AST.
- Tests
-
Index and search
- Not entirely sure?
- We can refer to a class without naming it. Might need updating?
-
Warnings (annotation-based, unused*, strict-mode-based, a few others)
- ErrorVerifier (report other errors and warnings)
- Error when we are missing the context type
- Error with asymmetric == and != (These errors might just belong in the ResolverVisitor?)
- From @FMorschel : Check
Ambiguous Import
to make sure it triggers correctly for this case too.
- ErrorVerifier (report other errors and warnings)
-
NodeLintRegistry
- If we make a new AST node representing enum shorthands, should add it to this.