-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
1 / 11 of 1 issue completedLabels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.feature-dot-shorthandsImplementation of the dot shorthands feature.Implementation of the dot shorthands feature.
Description
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 Importto 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.
Sub-issues
Metadata
Metadata
Assignees
Labels
P2A bug or feature request we're likely to work onA bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.feature-dot-shorthandsImplementation of the dot shorthands feature.Implementation of the dot shorthands feature.