Skip to content

Commit b922ada

Browse files
scheglovCommit Queue
authored and
Commit Queue
committed
Macro. Use sealed TypeAnnotationImpl and its subclasses to avoid 'default'.
Maybe? Change-Id: I67372e4269a2db5d2426f16a2af3ddd02766fca6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341334 Reviewed-by: Phil Quitslund <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 7a3df2c commit b922ada

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/analyzer/lib/src/summary2/macro_declarations.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,8 +1106,9 @@ class DeclarationBuilderFromNode {
11061106
}
11071107

11081108
macro.TypeAnnotationImpl _typeAnnotation(ast.TypeAnnotation node) {
1109+
node as ast.TypeAnnotationImpl;
11091110
switch (node) {
1110-
case ast.GenericFunctionType():
1111+
case ast.GenericFunctionTypeImpl():
11111112
return macro.FunctionTypeAnnotationImpl(
11121113
id: macro.RemoteInstance.uniqueId,
11131114
isNullable: node.question != null,
@@ -1122,12 +1123,10 @@ class DeclarationBuilderFromNode {
11221123
returnType: _typeAnnotationOrDynamic(node.returnType),
11231124
typeParameters: _typeParameters(node.typeParameters),
11241125
);
1125-
case ast.NamedType():
1126+
case ast.NamedTypeImpl():
11261127
return _namedType(node);
1127-
case ast.RecordTypeAnnotation():
1128+
case ast.RecordTypeAnnotationImpl():
11281129
return _typeAnnotationRecord(node);
1129-
default:
1130-
throw UnimplementedError('(${node.runtimeType}) $node');
11311130
}
11321131
}
11331132

0 commit comments

Comments
 (0)