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

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

Issue 2040673002: Resynthesize enum fields lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
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 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/constant/value.dart'; 10 import 'package:analyzer/dart/constant/value.dart';
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 return; 664 return;
665 } 665 }
666 expect(original, isNotNull); 666 expect(original, isNotNull);
667 expect(resynthesized, isNotNull, reason: desc); 667 expect(resynthesized, isNotNull, reason: desc);
668 if (rImpl is DefaultParameterElementImpl && oImpl is ParameterElementImpl) { 668 if (rImpl is DefaultParameterElementImpl && oImpl is ParameterElementImpl) {
669 // This is ok provided the resynthesized parameter element doesn't have 669 // This is ok provided the resynthesized parameter element doesn't have
670 // any evaluation result. 670 // any evaluation result.
671 expect(rImpl.evaluationResult, isNull); 671 expect(rImpl.evaluationResult, isNull);
672 } else { 672 } else {
673 Type rRuntimeType; 673 Type rRuntimeType;
674 if (rImpl is FunctionElementImpl) { 674 if (rImpl is ConstFieldElementImpl) {
675 rRuntimeType = ConstFieldElementImpl;
676 } else if (rImpl is FunctionElementImpl) {
675 rRuntimeType = FunctionElementImpl; 677 rRuntimeType = FunctionElementImpl;
676 } else { 678 } else {
677 rRuntimeType = rImpl.runtimeType; 679 rRuntimeType = rImpl.runtimeType;
678 } 680 }
679 expect(rRuntimeType, oImpl.runtimeType); 681 expect(rRuntimeType, oImpl.runtimeType);
680 } 682 }
681 expect(resynthesized.kind, original.kind); 683 expect(resynthesized.kind, original.kind);
682 expect(resynthesized.location, original.location, reason: desc); 684 expect(resynthesized.location, original.location, reason: desc);
683 expect(resynthesized.name, original.name); 685 expect(resynthesized.name, original.name);
684 expect(resynthesized.nameOffset, original.nameOffset, reason: desc); 686 expect(resynthesized.nameOffset, original.nameOffset, reason: desc);
(...skipping 3932 matching lines...) Expand 10 before | Expand all | Expand 10 after
4617 fail('Unexpectedly tried to get unlinked summary for $uri'); 4619 fail('Unexpectedly tried to get unlinked summary for $uri');
4618 } 4620 }
4619 return serializedUnit; 4621 return serializedUnit;
4620 } 4622 }
4621 4623
4622 @override 4624 @override
4623 bool hasLibrarySummary(String uri) { 4625 bool hasLibrarySummary(String uri) {
4624 return true; 4626 return true;
4625 } 4627 }
4626 } 4628 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698