Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1689)

Unified Diff: pkg/analyzer/test/generated/compile_time_error_code_test.dart

Issue 2656303004: Add a temporary analyzer error to work around #28515 (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/generated/compile_time_error_code_test.dart
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
index aabfe67874b9ac678e08f89f649eace3e5a688f1..3c95c9da539709978d5e16b8590aa375545af459 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -2441,6 +2441,51 @@ var b2 = const bool.fromEnvironment('x', defaultValue: 1);''');
verify([source]);
}
+ test_genericFunctionTypedParameter() async {
+ // Once dartbug.com/28515 is fixed, this syntax should no longer generate an
+ // error.
+ // TODO(paulberry): When dartbug.com/28515 is fixed, convert this into a
+ // NonErrorResolverTest.
+ Source source = addSource('void g(T f<T>(T x)) {}');
+ await computeAnalysisResult(source);
+ var expectedErrorCodes = <ErrorCode>[
+ CompileTimeErrorCode.GENERIC_FUNCTION_TYPED_PARAM_UNSUPPORTED
+ ];
+ if (enableNewAnalysisDriver) {
+ // Due to dartbug.com/28515, some additional errors appear when using the
+ // new analysis driver.
+ expectedErrorCodes.addAll([
+ StaticWarningCode.UNDEFINED_CLASS,
+ StaticWarningCode.UNDEFINED_CLASS
+ ]);
+ }
+ assertErrors(source, expectedErrorCodes);
+ verify([source]);
+ }
+
+ test_genericFunctionTypedParameter_commentSyntax() async {
+ // Once dartbug.com/28515 is fixed, this syntax should no longer generate an
+ // error.
+ // TODO(paulberry): When dartbug.com/28515 is fixed, convert this into a
+ // NonErrorResolverTest.
+ resetWith(options: new AnalysisOptionsImpl()..strongMode = true);
+ Source source = addSource('void g(/*=T*/ f/*<T>*/(/*=T*/ x)) {}');
+ await computeAnalysisResult(source);
+ var expectedErrorCodes = <ErrorCode>[
+ CompileTimeErrorCode.GENERIC_FUNCTION_TYPED_PARAM_UNSUPPORTED
+ ];
+ if (enableNewAnalysisDriver) {
+ // Due to dartbug.com/28515, some additional errors appear when using the
+ // new analysis driver.
+ expectedErrorCodes.addAll([
+ StaticWarningCode.UNDEFINED_CLASS,
+ StaticWarningCode.UNDEFINED_CLASS
+ ]);
+ }
+ assertErrors(source, expectedErrorCodes);
+ verify([source]);
+ }
+
test_getterAndMethodWithSameName() async {
Source source = addSource(r'''
class A {

Powered by Google App Engine
This is Rietveld 408576698