| OLD | NEW |
| 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 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 Source source = addSource(r''' | 617 Source source = addSource(r''' |
| 618 class A {} | 618 class A {} |
| 619 class B {} | 619 class B {} |
| 620 class as = A with B;'''); | 620 class as = A with B;'''); |
| 621 await computeAnalysisResult(source); | 621 await computeAnalysisResult(source); |
| 622 assertErrors( | 622 assertErrors( |
| 623 source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]); | 623 source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPEDEF_NAME]); |
| 624 verify([source]); | 624 verify([source]); |
| 625 } | 625 } |
| 626 | 626 |
| 627 test_builtInIdentifierAsPrefixName() async { |
| 628 Source source = addSource("import 'dart:async' as abstract;"); |
| 629 await computeAnalysisResult(source); |
| 630 assertErrors(source, [ |
| 631 CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_PREFIX_NAME, |
| 632 HintCode.UNUSED_IMPORT |
| 633 ]); |
| 634 verify([source]); |
| 635 } |
| 636 |
| 627 test_builtInIdentifierAsType_formalParameter_field() async { | 637 test_builtInIdentifierAsType_formalParameter_field() async { |
| 628 Source source = addSource(r''' | 638 Source source = addSource(r''' |
| 629 class A { | 639 class A { |
| 630 var x; | 640 var x; |
| 631 A(static this.x); | 641 A(static this.x); |
| 632 }'''); | 642 }'''); |
| 633 await computeAnalysisResult(source); | 643 await computeAnalysisResult(source); |
| 634 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); | 644 assertErrors(source, [CompileTimeErrorCode.BUILT_IN_IDENTIFIER_AS_TYPE]); |
| 635 verify([source]); | 645 verify([source]); |
| 636 } | 646 } |
| (...skipping 5852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6489 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); | 6499 source, [CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR]); |
| 6490 verify([source]); | 6500 verify([source]); |
| 6491 reset(); | 6501 reset(); |
| 6492 } | 6502 } |
| 6493 | 6503 |
| 6494 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { | 6504 Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async { |
| 6495 await _check_wrongNumberOfParametersForOperator(name, ""); | 6505 await _check_wrongNumberOfParametersForOperator(name, ""); |
| 6496 await _check_wrongNumberOfParametersForOperator(name, "a, b"); | 6506 await _check_wrongNumberOfParametersForOperator(name, "a, b"); |
| 6497 } | 6507 } |
| 6498 } | 6508 } |
| OLD | NEW |