diff --git a/flutter_frontend_server/lib/server.dart b/flutter_frontend_server/lib/server.dart index bd5125ce9b291..861ad11c572e5 100644 --- a/flutter_frontend_server/lib/server.dart +++ b/flutter_frontend_server/lib/server.dart @@ -224,7 +224,7 @@ class ToStringVisitor extends RecursiveVisitor { @override void visitProcedure(Procedure node) { if ( - node.name.name == 'toString' && + node.name.text == 'toString' && node.enclosingClass != null && node.enclosingLibrary != null && !node.isStatic && diff --git a/flutter_frontend_server/test/to_string_test.dart b/flutter_frontend_server/test/to_string_test.dart index 6391cfcc68de0..868667c9b98bd 100644 --- a/flutter_frontend_server/test/to_string_test.dart +++ b/flutter_frontend_server/test/to_string_test.dart @@ -194,7 +194,7 @@ void main(List args) async { final ReturnStatement replacement = verify(body.replaceWith(captureAny)).captured.single as ReturnStatement; expect(replacement.expression, isA()); final SuperMethodInvocation superMethodInvocation = replacement.expression as SuperMethodInvocation; - expect(superMethodInvocation.name.name, 'toString'); + expect(superMethodInvocation.name.text, 'toString'); } test('ToStringVisitor replaces toString in specified libraries (dart:ui)', () {