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

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

Issue 1803303002: Move all flags to CompilerOptions (first step to stop passing the compiler to (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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/compiler/lib/src/ssa/types_propagation.dart ('k') | pkg/compiler/lib/src/world.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) 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.dart'; 7 import 'common.dart';
8 import 'common/names.dart' show 8 import 'common/names.dart' show
9 Identifiers; 9 Identifiers;
10 import 'common/resolution.dart' show 10 import 'common/resolution.dart' show
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 } 551 }
552 552
553 /** 553 /**
554 * Check if a value of type [from] can be assigned to a variable, parameter or 554 * Check if a value of type [from] can be assigned to a variable, parameter or
555 * return value of type [to]. If `isConst == true`, an error is emitted in 555 * return value of type [to]. If `isConst == true`, an error is emitted in
556 * checked mode, otherwise a warning is issued. 556 * checked mode, otherwise a warning is issued.
557 */ 557 */
558 bool checkAssignable(Spannable spannable, DartType from, DartType to, 558 bool checkAssignable(Spannable spannable, DartType from, DartType to,
559 {bool isConst: false}) { 559 {bool isConst: false}) {
560 if (!types.isAssignable(from, to)) { 560 if (!types.isAssignable(from, to)) {
561 if (compiler.enableTypeAssertions && isConst) { 561 if (compiler.options.enableTypeAssertions && isConst) {
562 reporter.reportErrorMessage( 562 reporter.reportErrorMessage(
563 spannable, 563 spannable,
564 MessageKind.NOT_ASSIGNABLE, 564 MessageKind.NOT_ASSIGNABLE,
565 {'fromType': from, 'toType': to}); 565 {'fromType': from, 'toType': to});
566 } else { 566 } else {
567 reporter.reportWarningMessage( 567 reporter.reportWarningMessage(
568 spannable, 568 spannable,
569 MessageKind.NOT_ASSIGNABLE, 569 MessageKind.NOT_ASSIGNABLE,
570 {'fromType': from, 'toType': to}); 570 {'fromType': from, 'toType': to});
571 } 571 }
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2004 2004
2005 visitTypedef(Typedef node) { 2005 visitTypedef(Typedef node) {
2006 // Do not typecheck [Typedef] nodes. 2006 // Do not typecheck [Typedef] nodes.
2007 } 2007 }
2008 2008
2009 visitNode(Node node) { 2009 visitNode(Node node) {
2010 reporter.internalError(node, 2010 reporter.internalError(node,
2011 'Unexpected node ${node.getObjectDescription()} in the type checker.'); 2011 'Unexpected node ${node.getObjectDescription()} in the type checker.');
2012 } 2012 }
2013 } 2013 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/types_propagation.dart ('k') | pkg/compiler/lib/src/world.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698