Skip to content

Commit 058641a

Browse files
scheglovCommit Queue
authored andcommitted
Fine. Support for TypeLiteral.
Change-Id: I2ee92b0be99cbeea39cbd9d07166e073fc230846 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430322 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 87f5185 commit 058641a

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

pkg/analyzer/lib/src/fine/manifest_ast.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,11 @@ class _ElementCollector extends ThrowingAstVisitor<void> {
369369
node.visitChildren(this);
370370
}
371371

372+
@override
373+
void visitTypeLiteral(TypeLiteral node) {
374+
node.visitChildren(this);
375+
}
376+
372377
void _addElement(Element? element) {
373378
ManifestAstElementKind kind;
374379
int rawIndex;

pkg/analyzer/test/src/dart/analysis/driver_test.dart

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36351,6 +36351,52 @@ const d = b;
3635136351
);
3635236352
}
3635336353

36354+
test_manifest_constInitializer_typeLiteral() async {
36355+
await _runLibraryManifestScenario(
36356+
initialCode: r'''
36357+
const a = List<int>;
36358+
const b = List<int>;
36359+
const c = a;
36360+
const d = b;
36361+
''',
36362+
expectedInitialEvents: r'''
36363+
[operation] linkLibraryCycle SDK
36364+
[operation] linkLibraryCycle
36365+
package:test/test.dart
36366+
declaredGetters
36367+
a: #M0
36368+
b: #M1
36369+
c: #M2
36370+
d: #M3
36371+
declaredVariables
36372+
a: #M4
36373+
b: #M5
36374+
c: #M6
36375+
d: #M7
36376+
''',
36377+
updatedCode: r'''
36378+
const a = List<int>;
36379+
const b = List<double>;
36380+
const c = a;
36381+
const d = b;
36382+
''',
36383+
expectedUpdatedEvents: r'''
36384+
[operation] linkLibraryCycle
36385+
package:test/test.dart
36386+
declaredGetters
36387+
a: #M0
36388+
b: #M1
36389+
c: #M2
36390+
d: #M3
36391+
declaredVariables
36392+
a: #M4
36393+
b: #M8
36394+
c: #M6
36395+
d: #M9
36396+
''',
36397+
);
36398+
}
36399+
3635436400
test_manifest_enum_constants_replace() async {
3635536401
await _runLibraryManifestScenario(
3635636402
initialCode: r'''

0 commit comments

Comments
 (0)