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

Side by Side Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1168563004: Fix a corner case of constant constructor dependency computation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.constant; 8 library engine.constant;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 initializer.accept(referenceFinder); 450 initializer.accept(referenceFinder);
451 } 451 }
452 if (!superInvocationFound) { 452 if (!superInvocationFound) {
453 // No explicit superconstructor invocation found, so we need to 453 // No explicit superconstructor invocation found, so we need to
454 // manually insert a reference to the implicit superconstructor. 454 // manually insert a reference to the implicit superconstructor.
455 InterfaceType superclass = 455 InterfaceType superclass =
456 (constant.returnType as InterfaceType).superclass; 456 (constant.returnType as InterfaceType).superclass;
457 if (superclass != null && !superclass.isObject) { 457 if (superclass != null && !superclass.isObject) {
458 ConstructorElement unnamedConstructor = ConstantEvaluationEngine 458 ConstructorElement unnamedConstructor = ConstantEvaluationEngine
459 ._getConstructorBase(superclass.element.unnamedConstructor); 459 ._getConstructorBase(superclass.element.unnamedConstructor);
460 if (unnamedConstructor != null) { 460 if (unnamedConstructor != null && unnamedConstructor.isConst) {
461 callback(unnamedConstructor); 461 callback(unnamedConstructor);
462 } 462 }
463 } 463 }
464 } 464 }
465 for (FieldElement field in constant.enclosingElement.fields) { 465 for (FieldElement field in constant.enclosingElement.fields) {
466 // Note: non-static const isn't allowed but we handle it anyway so that 466 // Note: non-static const isn't allowed but we handle it anyway so that
467 // we won't be confused by incorrect code. 467 // we won't be confused by incorrect code.
468 if ((field.isFinal || field.isConst) && 468 if ((field.isFinal || field.isConst) &&
469 !field.isStatic && 469 !field.isStatic &&
470 field.initializer != null) { 470 field.initializer != null) {
(...skipping 4749 matching lines...) Expand 10 before | Expand all | Expand 10 after
5220 return BoolState.from(_element == rightElement); 5220 return BoolState.from(_element == rightElement);
5221 } else if (rightOperand is DynamicState) { 5221 } else if (rightOperand is DynamicState) {
5222 return BoolState.UNKNOWN_VALUE; 5222 return BoolState.UNKNOWN_VALUE;
5223 } 5223 }
5224 return BoolState.FALSE_STATE; 5224 return BoolState.FALSE_STATE;
5225 } 5225 }
5226 5226
5227 @override 5227 @override
5228 String toString() => _element == null ? "-unknown-" : _element.name; 5228 String toString() => _element == null ? "-unknown-" : _element.name;
5229 } 5229 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698