| 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.non_error_resolver_test; | 5 library analyzer.test.generated.non_error_resolver_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/src/generated/engine.dart'; | 9 import 'package:analyzer/src/generated/engine.dart'; |
| 10 import 'package:analyzer/src/generated/error.dart'; | 10 import 'package:analyzer/src/generated/error.dart'; |
| (...skipping 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 void test_constNotInitialized_local() { | 1470 void test_constNotInitialized_local() { |
| 1471 Source source = addSource(r''' | 1471 Source source = addSource(r''' |
| 1472 main() { | 1472 main() { |
| 1473 const int x = 0; | 1473 const int x = 0; |
| 1474 }'''); | 1474 }'''); |
| 1475 computeLibrarySourceErrors(source); | 1475 computeLibrarySourceErrors(source); |
| 1476 assertNoErrors(source); | 1476 assertNoErrors(source); |
| 1477 verify([source]); | 1477 verify([source]); |
| 1478 } | 1478 } |
| 1479 | 1479 |
| 1480 void test_constRedirectSkipsSupertype() { |
| 1481 // Since C redirects to C.named, it doesn't implicitly refer to B's |
| 1482 // unnamed constructor. Therefore there is no cycle. |
| 1483 Source source = addSource(''' |
| 1484 class B { |
| 1485 final x; |
| 1486 const B() : x = y; |
| 1487 const B.named() : x = null; |
| 1488 } |
| 1489 class C extends B { |
| 1490 const C() : this.named(); |
| 1491 const C.named() : super.named(); |
| 1492 } |
| 1493 const y = const C(); |
| 1494 '''); |
| 1495 computeLibrarySourceErrors(source); |
| 1496 assertNoErrors(source); |
| 1497 verify([source]); |
| 1498 } |
| 1499 |
| 1480 void test_constructorDeclaration_scope_signature() { | 1500 void test_constructorDeclaration_scope_signature() { |
| 1481 Source source = addSource(r''' | 1501 Source source = addSource(r''' |
| 1482 const app = 0; | 1502 const app = 0; |
| 1483 class A { | 1503 class A { |
| 1484 A(@app int app) {} | 1504 A(@app int app) {} |
| 1485 }'''); | 1505 }'''); |
| 1486 computeLibrarySourceErrors(source); | 1506 computeLibrarySourceErrors(source); |
| 1487 assertNoErrors(source); | 1507 assertNoErrors(source); |
| 1488 verify([source]); | 1508 verify([source]); |
| 1489 } | 1509 } |
| (...skipping 4578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6068 reset(); | 6088 reset(); |
| 6069 } | 6089 } |
| 6070 | 6090 |
| 6071 void _check_wrongNumberOfParametersForOperator1(String name) { | 6091 void _check_wrongNumberOfParametersForOperator1(String name) { |
| 6072 _check_wrongNumberOfParametersForOperator(name, "a"); | 6092 _check_wrongNumberOfParametersForOperator(name, "a"); |
| 6073 } | 6093 } |
| 6074 | 6094 |
| 6075 CompilationUnit _getResolvedLibraryUnit(Source source) => | 6095 CompilationUnit _getResolvedLibraryUnit(Source source) => |
| 6076 analysisContext.getResolvedCompilationUnit2(source, source); | 6096 analysisContext.getResolvedCompilationUnit2(source, source); |
| 6077 } | 6097 } |
| OLD | NEW |