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/lib/src/summary/link.dart

Issue 1864753002: Use isValidConst flag to distinguish between const / final expressions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merge and tweaks. Created 4 years, 8 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/idl.dart ('k') | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /** 5 /**
6 * This library is capable of producing linked summaries from unlinked 6 * This library is capable of producing linked summaries from unlinked
7 * ones (or prelinked ones). It functions by building a miniature 7 * ones (or prelinked ones). It functions by building a miniature
8 * element model to represent the contents of the summaries, and then 8 * element model to represent the contents of the summaries, and then
9 * scanning the element model to gather linked information and adding 9 * scanning the element model to gather linked information and adding
10 * it to the summary data structures. 10 * it to the summary data structures.
(...skipping 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2283 dependencies, 2283 dependencies,
2284 variableElement.unlinkedVariable.constExpr, 2284 variableElement.unlinkedVariable.constExpr,
2285 variableElement.compilationUnit); 2285 variableElement.compilationUnit);
2286 return dependencies; 2286 return dependencies;
2287 } 2287 }
2288 2288
2289 @override 2289 @override
2290 void evaluate(bool inCycle) { 2290 void evaluate(bool inCycle) {
2291 if (inCycle) { 2291 if (inCycle) {
2292 _inferredType = DynamicTypeImpl.instance; 2292 _inferredType = DynamicTypeImpl.instance;
2293 } else if (variableElement.unlinkedVariable.constExpr.isInvalid) { 2293 } else if (!variableElement.unlinkedVariable.constExpr.isValidConst) {
2294 // TODO(paulberry): implement. 2294 // TODO(paulberry): delete this case and fix errors.
2295 throw new UnimplementedError(); 2295 throw new UnimplementedError();
2296 } else { 2296 } else {
2297 // Perform RPN evaluation of the cycle, using a stack of 2297 // Perform RPN evaluation of the cycle, using a stack of
2298 // inferred types. 2298 // inferred types.
2299 List<DartType> stack = <DartType>[]; 2299 List<DartType> stack = <DartType>[];
2300 int refPtr = 0; 2300 int refPtr = 0;
2301 int intPtr = 0; 2301 int intPtr = 0;
2302 UnlinkedConst unlinkedConst = variableElement.unlinkedVariable.constExpr; 2302 UnlinkedConst unlinkedConst = variableElement.unlinkedVariable.constExpr;
2303 TypeProvider typeProvider = 2303 TypeProvider typeProvider =
2304 variableElement.compilationUnit.enclosingElement._linker.typeProvider; 2304 variableElement.compilationUnit.enclosingElement._linker.typeProvider;
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
2844 /** 2844 /**
2845 * Throw away any information stored in the summary by a previous call to 2845 * Throw away any information stored in the summary by a previous call to
2846 * [link]. 2846 * [link].
2847 */ 2847 */
2848 void unlink() { 2848 void unlink() {
2849 for (LibraryElementInBuildUnit library in _librariesInBuildUnit) { 2849 for (LibraryElementInBuildUnit library in _librariesInBuildUnit) {
2850 library.unlink(); 2850 library.unlink();
2851 } 2851 }
2852 } 2852 }
2853 } 2853 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/idl.dart ('k') | pkg/analyzer/lib/src/summary/resynthesize.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698