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

Side by Side Diff: pkg/analyzer/test/src/summary/resynthesize_common.dart

Issue 2740943005: Fix for type reference for 'MyEnum.myValue.index'. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 5425 matching lines...) Expand 10 before | Expand all | Expand 10 after
5436 '''); 5436 ''');
5437 } else { 5437 } else {
5438 checkElementText( 5438 checkElementText(
5439 library, 5439 library,
5440 r''' 5440 r'''
5441 const dynamic v = const {0: 'aaa', 1: 'bbb', 2: 'ccc'}; 5441 const dynamic v = const {0: 'aaa', 1: 'bbb', 2: 'ccc'};
5442 '''); 5442 ''');
5443 } 5443 }
5444 } 5444 }
5445 5445
5446 test_constExpr_pushReference_enum_field() {
5447 var library = checkLibrary('''
5448 enum E {a, b, c}
5449 final vValue = E.a;
5450 final vValues = E.values;
5451 final vIndex = E.a.index;
5452 ''');
5453 if (isStrongMode) {
5454 checkElementText(
5455 library,
5456 r'''
5457 enum E {
5458 final int index;
5459 static const List<E> values;
5460 static const E a;
5461 static const E b;
5462 static const E c;
5463 }
5464 final E vValue;
5465 final List<E> vValues;
5466 final int vIndex;
5467 ''');
5468 } else {
5469 checkElementText(
5470 library,
5471 r'''
5472 enum E {
5473 final int index;
5474 static const List<E> values;
5475 static const E a;
5476 static const E b;
5477 static const E c;
5478 }
5479 final dynamic vValue;
5480 final dynamic vValues;
5481 final dynamic vIndex;
5482 ''');
5483 }
5484 }
5485
5446 test_constExpr_pushReference_field_simpleIdentifier() { 5486 test_constExpr_pushReference_field_simpleIdentifier() {
5447 var library = checkLibrary(''' 5487 var library = checkLibrary('''
5448 class C { 5488 class C {
5449 static const a = b; 5489 static const a = b;
5450 static const b = null; 5490 static const b = null;
5451 } 5491 }
5452 '''); 5492 ''');
5453 if (isStrongMode) { 5493 if (isStrongMode) {
5454 checkElementText( 5494 checkElementText(
5455 library, 5495 library,
(...skipping 9455 matching lines...) Expand 10 before | Expand all | Expand 10 after
14911 fail('Unexpectedly tried to get unlinked summary for $uri'); 14951 fail('Unexpectedly tried to get unlinked summary for $uri');
14912 } 14952 }
14913 return serializedUnit; 14953 return serializedUnit;
14914 } 14954 }
14915 14955
14916 @override 14956 @override
14917 bool hasLibrarySummary(String uri) { 14957 bool hasLibrarySummary(String uri) {
14918 return true; 14958 return true;
14919 } 14959 }
14920 } 14960 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/link.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698