Version 2.12.0-122.0.dev
Merge commit 'f1916cf0bbb524e0b545d19fdfce2f6b586047d6' into 'dev'
diff --git a/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart b/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
index dcf0d9d..dc990de 100644
--- a/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
+++ b/pkg/analyzer/lib/src/dart/resolver/type_property_resolver.dart
@@ -233,7 +233,10 @@
return ResolutionResult(
getter: getter,
- needsGetterError: _needsGetterError && !_reportedGetterError,
+ // Parser recovery resulting in an empty property name should not be
+ // reported as an undefined getter.
+ needsGetterError:
+ _needsGetterError && _name.isNotEmpty && !_reportedGetterError,
setter: setter,
needsSetterError: _needsSetterError && !_reportedSetterError,
);
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart
index 814771c..1c3e268 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_getter_test.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:analyzer/src/dart/error/syntactic_errors.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -47,6 +48,18 @@
]);
}
+ test_emptyName() async {
+ await assertErrorsInCode('''
+class A {
+}
+main() {
+ print(A().);
+}
+''', [
+ error(ParserErrorCode.MISSING_IDENTIFIER, 33, 1),
+ ]);
+ }
+
test_extension_instance_extendedHasSetter_extensionHasGetter() async {
await assertErrorsInCode('''
class C {
diff --git a/tests/language/cascade/cascade_test.dart b/tests/language/cascade/cascade_test.dart
index 7e674f5..f9ddcd2 100644
--- a/tests/language/cascade/cascade_test.dart
+++ b/tests/language/cascade/cascade_test.dart
@@ -92,12 +92,8 @@
// ^^
// [analyzer] SYNTACTIC_ERROR.MISSING_IDENTIFIER
// [cfe] Expected an identifier, but got '37'.
- // [error line 91, column 8, length 0]
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
a.."foo";
// ^^^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_IDENTIFIER
// [cfe] Expected an identifier, but got '"foo"'.
- // [error line 97, column 11, length 0]
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
}
diff --git a/tests/language/this/conditional_operator_test.dart b/tests/language/this/conditional_operator_test.dart
index cda4689..e03f998 100644
--- a/tests/language/this/conditional_operator_test.dart
+++ b/tests/language/this/conditional_operator_test.dart
@@ -21,7 +21,6 @@
//^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD
// [error line 15, column 11, length 0]
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] Expected '.' before this.
// ^^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
diff --git a/tests/language/variable/illegal_initializer_test.dart b/tests/language/variable/illegal_initializer_test.dart
index 6924b69..3b8b083 100644
--- a/tests/language/variable/illegal_initializer_test.dart
+++ b/tests/language/variable/illegal_initializer_test.dart
@@ -45,7 +45,6 @@
// ^^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER
// [error line 39, column 16, length 0]
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] Expected '.' before this.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
diff --git a/tests/language_2/cascade/cascade_test.dart b/tests/language_2/cascade/cascade_test.dart
index 7e674f5..f9ddcd2 100644
--- a/tests/language_2/cascade/cascade_test.dart
+++ b/tests/language_2/cascade/cascade_test.dart
@@ -92,12 +92,8 @@
// ^^
// [analyzer] SYNTACTIC_ERROR.MISSING_IDENTIFIER
// [cfe] Expected an identifier, but got '37'.
- // [error line 91, column 8, length 0]
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
a.."foo";
// ^^^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_IDENTIFIER
// [cfe] Expected an identifier, but got '"foo"'.
- // [error line 97, column 11, length 0]
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
}
diff --git a/tests/language_2/this/conditional_operator_test.dart b/tests/language_2/this/conditional_operator_test.dart
index 9ccddb2..064153a 100644
--- a/tests/language_2/this/conditional_operator_test.dart
+++ b/tests/language_2/this/conditional_operator_test.dart
@@ -21,7 +21,6 @@
//^^^^^^^^^^^^^^^^^^^^^^^^
// [analyzer] COMPILE_TIME_ERROR.INITIALIZER_FOR_NON_EXISTENT_FIELD
// [error line 15, column 11, length 0]
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] Expected '.' before this.
// ^^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
diff --git a/tests/language_2/variable/illegal_initializer_test.dart b/tests/language_2/variable/illegal_initializer_test.dart
index 6924b69..3b8b083 100644
--- a/tests/language_2/variable/illegal_initializer_test.dart
+++ b/tests/language_2/variable/illegal_initializer_test.dart
@@ -45,7 +45,6 @@
// ^^^^
// [analyzer] SYNTACTIC_ERROR.MISSING_ASSIGNMENT_IN_INITIALIZER
// [error line 39, column 16, length 0]
- // [analyzer] COMPILE_TIME_ERROR.UNDEFINED_GETTER
// [cfe] Expected '.' before this.
// ^
// [analyzer] SYNTACTIC_ERROR.EXPECTED_TOKEN
diff --git a/tools/VERSION b/tools/VERSION
index 59e7c67..bd01ef4 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 12
PATCH 0
-PRERELEASE 121
+PRERELEASE 122
PRERELEASE_PATCH 0
\ No newline at end of file