OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2447 library lib; | 2447 library lib; |
2448 part 'a.dart'; | 2448 part 'a.dart'; |
2449 -------------------- | 2449 -------------------- |
2450 unit: a.dart | 2450 unit: a.dart |
2451 | 2451 |
2452 final dynamic f; | 2452 final dynamic f; |
2453 '''); | 2453 '''); |
2454 } | 2454 } |
2455 } | 2455 } |
2456 | 2456 |
| 2457 test_const_finalField_hasConstConstructor() async { |
| 2458 var library = await checkLibrary(r''' |
| 2459 class C { |
| 2460 final int f = 42; |
| 2461 const C(); |
| 2462 } |
| 2463 '''); |
| 2464 checkElementText(library, r''' |
| 2465 class C { |
| 2466 final int f = 42; |
| 2467 const C(); |
| 2468 } |
| 2469 '''); |
| 2470 } |
| 2471 |
2457 test_const_invalid_field_const() async { | 2472 test_const_invalid_field_const() async { |
2458 variablesWithNotConstInitializers.add('f'); | 2473 variablesWithNotConstInitializers.add('f'); |
2459 var library = await checkLibrary(r''' | 2474 var library = await checkLibrary(r''' |
2460 class C { | 2475 class C { |
2461 static const f = 1 + foo(); | 2476 static const f = 1 + foo(); |
2462 } | 2477 } |
2463 int foo() => 42; | 2478 int foo() => 42; |
2464 ''', allowErrors: true); | 2479 ''', allowErrors: true); |
2465 if (isStrongMode) { | 2480 if (isStrongMode) { |
2466 checkElementText(library, r''' | 2481 checkElementText(library, r''' |
(...skipping 7602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10069 fail('Unexpectedly tried to get unlinked summary for $uri'); | 10084 fail('Unexpectedly tried to get unlinked summary for $uri'); |
10070 } | 10085 } |
10071 return serializedUnit; | 10086 return serializedUnit; |
10072 } | 10087 } |
10073 | 10088 |
10074 @override | 10089 @override |
10075 bool hasLibrarySummary(String uri) { | 10090 bool hasLibrarySummary(String uri) { |
10076 return true; | 10091 return true; |
10077 } | 10092 } |
10078 } | 10093 } |
OLD | NEW |