| Index: pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| index 7eb3ad549b49e9e2fdc43a530e536be6212e7a77..46b7b2d9990fef15813062a70c771c1601d6693a 100644
|
| --- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| +++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
|
| @@ -567,7 +567,7 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
|
| NodeList<Annotation> annotations,
|
| bool isFinal,
|
| bool isConst,
|
| - TypeAnnotation type,
|
| + TypeName type,
|
| bool assignPropagatedTypeSlot,
|
| SimpleIdentifier declaredIdentifier) {
|
| UnlinkedVariableBuilder b = new UnlinkedVariableBuilder();
|
| @@ -615,7 +615,7 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
|
| int nameOffset,
|
| bool isGetter,
|
| bool isSetter,
|
| - TypeAnnotation returnType,
|
| + TypeName returnType,
|
| FormalParameterList formalParameters,
|
| FunctionBody body,
|
| bool isTopLevel,
|
| @@ -764,7 +764,7 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
|
| * parameter and store them in [b].
|
| */
|
| void serializeFunctionTypedParameterDetails(UnlinkedParamBuilder b,
|
| - TypeAnnotation returnType, FormalParameterList parameters) {
|
| + TypeName returnType, FormalParameterList parameters) {
|
| EntityRefBuilder serializedReturnType = serializeTypeName(returnType);
|
| if (serializedReturnType != null) {
|
| b.type = serializedReturnType;
|
| @@ -933,13 +933,8 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
|
| * a [EntityRef]. Note that this method does the right thing if the
|
| * name doesn't refer to an entity other than a type (e.g. a class member).
|
| */
|
| - EntityRefBuilder serializeTypeName(TypeAnnotation node) {
|
| - if (node is TypeName) {
|
| - return serializeType(node?.name, node?.typeArguments);
|
| - } else if (node != null) {
|
| - throw new ArgumentError('Cannot serialize a ${node.runtimeType}');
|
| - }
|
| - return null;
|
| + EntityRefBuilder serializeTypeName(TypeName node) {
|
| + return serializeType(node?.name, node?.typeArguments);
|
| }
|
|
|
| /**
|
| @@ -1402,6 +1397,14 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
|
| }
|
|
|
| /**
|
| + * Helper method to determine if a given [typeName] refers to `dynamic`.
|
| + */
|
| + static bool isDynamic(TypeName typeName) {
|
| + Identifier name = typeName.name;
|
| + return name is SimpleIdentifier && name.name == 'dynamic';
|
| + }
|
| +
|
| + /**
|
| * Compute the API signature of the unit and record it.
|
| */
|
| static void _computeApiSignature(UnlinkedUnitBuilder b) {
|
|
|