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

Side by Side Diff: pkg/compiler/lib/src/typechecker.dart

Issue 2596483003: Fix defaultValue in analyzeInPromotedContext (Closed)
Patch Set: Created 3 years, 12 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 | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 dart2js.typechecker; 5 library dart2js.typechecker;
6 6
7 import 'common/names.dart' show Identifiers; 7 import 'common/names.dart' show Identifiers;
8 import 'common/resolution.dart' show Resolution; 8 import 'common/resolution.dart' show Resolution;
9 import 'common/tasks.dart' show CompilerTask; 9 import 'common/tasks.dart' show CompilerTask;
10 import 'common.dart'; 10 import 'common.dart';
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 531
532 for (TypePromotion typePromotion in getShownTypePromotionsFor(right)) { 532 for (TypePromotion typePromotion in getShownTypePromotionsFor(right)) {
533 typePromotion = typePromotion.copy(); 533 typePromotion = typePromotion.copy();
534 checkTypePromotion(right, typePromotion); 534 checkTypePromotion(right, typePromotion);
535 showTypePromotion(node, typePromotion); 535 showTypePromotion(node, typePromotion);
536 } 536 }
537 } 537 }
538 538
539 /// Analyze [node] in the context of the known types shown in [context]. 539 /// Analyze [node] in the context of the known types shown in [context].
540 DartType analyzeInPromotedContext(Node context, Node node, 540 DartType analyzeInPromotedContext(Node context, Node node,
541 {bool mustHaveType: false}) { 541 {bool mustHaveType: true}) {
542 Link<TypePromotion> knownForNode = const Link<TypePromotion>(); 542 Link<TypePromotion> knownForNode = const Link<TypePromotion>();
543 for (TypePromotion typePromotion in getShownTypePromotionsFor(context)) { 543 for (TypePromotion typePromotion in getShownTypePromotionsFor(context)) {
544 typePromotion = typePromotion.copy(); 544 typePromotion = typePromotion.copy();
545 checkTypePromotion(node, typePromotion, checkAccesses: true); 545 checkTypePromotion(node, typePromotion, checkAccesses: true);
546 knownForNode = knownForNode.prepend(typePromotion); 546 knownForNode = knownForNode.prepend(typePromotion);
547 registerKnownTypePromotion(typePromotion); 547 registerKnownTypePromotion(typePromotion);
548 } 548 }
549 549
550 final DartType type = analyze(node, mustHaveType: mustHaveType); 550 final DartType type = analyze(node, mustHaveType: mustHaveType);
551 551
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 2026
2027 visitTypedef(Typedef node) { 2027 visitTypedef(Typedef node) {
2028 // Do not typecheck [Typedef] nodes. 2028 // Do not typecheck [Typedef] nodes.
2029 } 2029 }
2030 2030
2031 visitNode(Node node) { 2031 visitNode(Node node) {
2032 reporter.internalError(node, 2032 reporter.internalError(node,
2033 'Unexpected node ${node.getObjectDescription()} in the type checker.'); 2033 'Unexpected node ${node.getObjectDescription()} in the type checker.');
2034 } 2034 }
2035 } 2035 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698