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

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

Issue 2745283007: Fix also type inference for enum method invocation. (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 5465 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
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