From abc0cbe3fd3bbeecaf52e24caa5a4d413cc1ee11 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Fri, 21 Apr 2023 10:27:13 -0700 Subject: [PATCH] [pigeon] Update for compatibility with a future change to the analyzer. --- packages/pigeon/lib/pigeon_lib.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/pigeon/lib/pigeon_lib.dart b/packages/pigeon/lib/pigeon_lib.dart index 9c46b0447dd..932f548be00 100644 --- a/packages/pigeon/lib/pigeon_lib.dart +++ b/packages/pigeon/lib/pigeon_lib.dart @@ -1071,15 +1071,14 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { if (_currentApi != null) { // Methods without named return types aren't supported. final dart_ast.TypeAnnotation returnType = node.returnType!; - final dart_ast.SimpleIdentifier returnTypeIdentifier = - getFirstChildOfType(returnType)!; + returnType as dart_ast.NamedType; _currentApi!.methods.add( Method( name: node.name.lexeme, returnType: TypeDeclaration( - baseName: returnTypeIdentifier.name, - typeArguments: typeAnnotationsToTypeArguments( - (returnType as dart_ast.NamedType).typeArguments), + baseName: returnType.name.name, + typeArguments: + typeAnnotationsToTypeArguments(returnType.typeArguments), isNullable: returnType.question != null), arguments: arguments, isAsynchronous: isAsynchronous,