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

Side by Side Diff: pkg/analyzer/test/generated/compile_time_error_code_test.dart

Issue 2290373003: Move error checking from scope creation to error reporter (take 2) (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.test.generated.compile_time_error_code_test; 5 library analyzer.test.generated.compile_time_error_code_test;
6 6
7 import 'package:analyzer/src/generated/engine.dart'; 7 import 'package:analyzer/src/generated/engine.dart';
8 import 'package:analyzer/src/generated/error.dart'; 8 import 'package:analyzer/src/generated/error.dart';
9 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode; 9 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
10 import 'package:analyzer/src/generated/source_io.dart'; 10 import 'package:analyzer/src/generated/source_io.dart';
(...skipping 2316 matching lines...) Expand 10 before | Expand all | Expand 10 after
2327 verify([source]); 2327 verify([source]);
2328 } 2328 }
2329 2329
2330 void test_finalInitializedMultipleTimes_initializingFormals() { 2330 void test_finalInitializedMultipleTimes_initializingFormals() {
2331 Source source = addSource(r''' 2331 Source source = addSource(r'''
2332 class A { 2332 class A {
2333 final x; 2333 final x;
2334 A(this.x, this.x) {} 2334 A(this.x, this.x) {}
2335 }'''); 2335 }''');
2336 computeLibrarySourceErrors(source); 2336 computeLibrarySourceErrors(source);
2337 assertErrors( 2337 assertErrors(source, [
2338 source, [CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES]); 2338 CompileTimeErrorCode.DUPLICATE_DEFINITION,
2339 CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES
2340 ]);
2339 verify([source]); 2341 verify([source]);
2340 } 2342 }
2341 2343
2342 void test_finalNotInitialized_instanceField_const_static() { 2344 void test_finalNotInitialized_instanceField_const_static() {
2343 Source source = addSource(r''' 2345 Source source = addSource(r'''
2344 class A { 2346 class A {
2345 static const F; 2347 static const F;
2346 }'''); 2348 }''');
2347 computeLibrarySourceErrors(source); 2349 computeLibrarySourceErrors(source);
2348 assertErrors(source, [CompileTimeErrorCode.CONST_NOT_INITIALIZED]); 2350 assertErrors(source, [CompileTimeErrorCode.CONST_NOT_INITIALIZED]);
(...skipping 4001 matching lines...) Expand 10 before | Expand all | Expand 10 after
6350 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); 6352 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]);
6351 verify([source]); 6353 verify([source]);
6352 reset(); 6354 reset();
6353 } 6355 }
6354 6356
6355 void _check_wrongNumberOfParametersForOperator1(String name) { 6357 void _check_wrongNumberOfParametersForOperator1(String name) {
6356 _check_wrongNumberOfParametersForOperator(name, ""); 6358 _check_wrongNumberOfParametersForOperator(name, "");
6357 _check_wrongNumberOfParametersForOperator(name, "a, b"); 6359 _check_wrongNumberOfParametersForOperator(name, "a, b");
6358 } 6360 }
6359 } 6361 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error_verifier.dart ('k') | pkg/analyzer/test/generated/non_error_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698