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

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

Issue 2178123003: Issue 26860. Report CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR for parameters of fu… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5bd95e5bb264d7692d3ae7daaa746aa539cf67a8..f3e477a1a06c79bb543cb8d003434ec1a73491cc 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -2244,6 +2244,18 @@ class A {
verify([source]);
}
+ void test_fieldInitializerOutsideConstructor_inFunctionTypeParameter() {
+ Source source = addSource(r'''
+class A {
+ int x;
+ A(int p(this.x));
+}''');
+ computeLibrarySourceErrors(source);
+ assertErrors(
+ source, [CompileTimeErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
+ verify([source]);
+ }
+
void test_fieldInitializerRedirectingConstructor_afterRedirection() {
Source source = addSource(r'''
class A {
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698