Skip to content

Commit

Permalink
[pigeon] Ignore deprecated name (flutter#3953)
Browse files Browse the repository at this point in the history
Ignores a field deprecated in the latest `analyzer` update, causing out-of-band analyzer failures.

This is ignored for now rather than replaced to avoid dropping currently-supported Flutter versions in Pigeon right now.

Fixes flutter#126393
  • Loading branch information
stuartmorgan authored May 10, 2023
1 parent dfcb21c commit 0167d83
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/pigeon/lib/pigeon_lib.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,9 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
final dart_ast.NamedType? namedType =
getFirstChildOfType<dart_ast.NamedType>(parameter);
if (namedType != null) {
// TODO(stuartmorgan): Replace `name` when adopting the next version of
// analyzer.
// ignore: deprecated_member_use
final String argTypeBaseName = namedType.name.name;
final bool isNullable = namedType.question != null;
final List<TypeDeclaration> argTypeArguments =
Expand Down Expand Up @@ -1086,6 +1089,9 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
Method(
name: node.name.lexeme,
returnType: TypeDeclaration(
// TODO(stuartmorgan): Replace `name` when adopting the next
// version of analyzer.
// ignore: deprecated_member_use
baseName: returnType.name.name,
typeArguments:
typeAnnotationsToTypeArguments(returnType.typeArguments),
Expand Down Expand Up @@ -1135,6 +1141,9 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
for (final Object x in typeArguments.childEntities) {
if (x is dart_ast.NamedType) {
result.add(TypeDeclaration(
// TODO(stuartmorgan): Replace `name` when adopting the next
// version of analyzer.
// ignore: deprecated_member_use
baseName: x.name.name,
isNullable: x.question != null,
typeArguments: typeAnnotationsToTypeArguments(x.typeArguments)));
Expand Down Expand Up @@ -1165,6 +1174,9 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor<Object?> {
final dart_ast.TypeArgumentList? typeArguments = type.typeArguments;
_currentClass!.fields.add(NamedType(
type: TypeDeclaration(
// TODO(stuartmorgan): Replace `name` when adopting the next
// version of analyzer.
// ignore: deprecated_member_use
baseName: type.name.name,
isNullable: type.question != null,
typeArguments: typeAnnotationsToTypeArguments(typeArguments),
Expand Down

0 comments on commit 0167d83

Please sign in to comment.