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 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
9 import 'package:analyzer/dart/constant/value.dart'; | 9 import 'package:analyzer/dart/constant/value.dart'; |
10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
(...skipping 5465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5476 static const E b; | 5476 static const E b; |
5477 static const E c; | 5477 static const E c; |
5478 } | 5478 } |
5479 final dynamic vValue; | 5479 final dynamic vValue; |
5480 final dynamic vValues; | 5480 final dynamic vValues; |
5481 final dynamic vIndex; | 5481 final dynamic vIndex; |
5482 '''); | 5482 '''); |
5483 } | 5483 } |
5484 } | 5484 } |
5485 | 5485 |
| 5486 test_constExpr_pushReference_enum_method() { |
| 5487 var library = checkLibrary(''' |
| 5488 enum E {a} |
| 5489 final vToString = E.a.toString(); |
| 5490 '''); |
| 5491 if (isStrongMode) { |
| 5492 checkElementText( |
| 5493 library, |
| 5494 r''' |
| 5495 enum E { |
| 5496 final int index; |
| 5497 static const List<E> values; |
| 5498 static const E a; |
| 5499 } |
| 5500 final String vToString; |
| 5501 '''); |
| 5502 } else { |
| 5503 checkElementText( |
| 5504 library, |
| 5505 r''' |
| 5506 enum E { |
| 5507 final int index; |
| 5508 static const List<E> values; |
| 5509 static const E a; |
| 5510 } |
| 5511 final dynamic vToString; |
| 5512 '''); |
| 5513 } |
| 5514 } |
| 5515 |
5486 test_constExpr_pushReference_field_simpleIdentifier() { | 5516 test_constExpr_pushReference_field_simpleIdentifier() { |
5487 var library = checkLibrary(''' | 5517 var library = checkLibrary(''' |
5488 class C { | 5518 class C { |
5489 static const a = b; | 5519 static const a = b; |
5490 static const b = null; | 5520 static const b = null; |
5491 } | 5521 } |
5492 '''); | 5522 '''); |
5493 if (isStrongMode) { | 5523 if (isStrongMode) { |
5494 checkElementText( | 5524 checkElementText( |
5495 library, | 5525 library, |
(...skipping 9455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14951 fail('Unexpectedly tried to get unlinked summary for $uri'); | 14981 fail('Unexpectedly tried to get unlinked summary for $uri'); |
14952 } | 14982 } |
14953 return serializedUnit; | 14983 return serializedUnit; |
14954 } | 14984 } |
14955 | 14985 |
14956 @override | 14986 @override |
14957 bool hasLibrarySummary(String uri) { | 14987 bool hasLibrarySummary(String uri) { |
14958 return true; | 14988 return true; |
14959 } | 14989 } |
14960 } | 14990 } |
OLD | NEW |