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

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

Issue 2643693002: Fix language/bad_constructor_test in dartk and analyzer. (Closed)
Patch Set: Remove extra blank line 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 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 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analyzer/error/error.dart'; 9 import 'package:analyzer/error/error.dart';
10 import 'package:analyzer/src/error/codes.dart'; 10 import 'package:analyzer/src/error/codes.dart';
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 class A { 706 class A {
707 int x; 707 int x;
708 A.x() {} 708 A.x() {}
709 }'''); 709 }''');
710 await computeAnalysisResult(source); 710 await computeAnalysisResult(source);
711 assertErrors( 711 assertErrors(
712 source, [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD]); 712 source, [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD]);
713 verify([source]); 713 verify([source]);
714 } 714 }
715 715
716 test_conflictingConstructorNameAndMember_getter() async {
717 Source source = addSource(r'''
718 class A {
719 int get x => 42;
720 A.x() {}
721 }''');
722 await computeAnalysisResult(source);
723 assertErrors(
724 source, [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD]);
725 verify([source]);
726 }
727
716 test_conflictingConstructorNameAndMember_method() async { 728 test_conflictingConstructorNameAndMember_method() async {
717 Source source = addSource(r''' 729 Source source = addSource(r'''
718 class A { 730 class A {
719 const A.x(); 731 const A.x();
720 void x() {} 732 void x() {}
721 }'''); 733 }''');
722 await computeAnalysisResult(source); 734 await computeAnalysisResult(source);
723 assertErrors( 735 assertErrors(
724 source, [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD]); 736 source, [CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD]);
725 verify([source]); 737 verify([source]);
(...skipping 5711 matching lines...) Expand 10 before | Expand all | Expand 10 after
6437 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); 6449 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]);
6438 verify([source]); 6450 verify([source]);
6439 reset(); 6451 reset();
6440 } 6452 }
6441 6453
6442 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { 6454 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async {
6443 await _check_wrongNumberOfParametersForOperator(name, ""); 6455 await _check_wrongNumberOfParametersForOperator(name, "");
6444 await _check_wrongNumberOfParametersForOperator(name, "a, b"); 6456 await _check_wrongNumberOfParametersForOperator(name, "a, b");
6445 } 6457 }
6446 } 6458 }
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