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

Side by Side Diff: pkg/analyzer/lib/src/task/strong/info.dart

Issue 1833553002: Treat DownCastComposite as a StaticWarning, not a StaticTypeWarning. (Closed) Base URL: https://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 | « 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) 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 /// Defines static information collected by the type checker and used later by 5 /// Defines static information collected by the type checker and used later by
6 /// emitters to generate code. 6 /// emitters to generate code.
7 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be 7 // TODO(jmesserly): this was ported from package:dev_compiler, and needs to be
8 // refactored to fit into analyzer. 8 // refactored to fit into analyzer.
9 library analyzer.src.task.strong.info; 9 library analyzer.src.task.strong.info;
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 /// A down cast to a non-ground type. These behave differently from standard 163 /// A down cast to a non-ground type. These behave differently from standard
164 /// Dart and may be more likely to fail at runtime. 164 /// Dart and may be more likely to fail at runtime.
165 class DownCastComposite extends DownCast { 165 class DownCastComposite extends DownCast {
166 DownCastComposite(TypeSystem rules, Expression expression, DartType fromType, 166 DownCastComposite(TypeSystem rules, Expression expression, DartType fromType,
167 DartType toType) 167 DartType toType)
168 : super._internal(rules, expression, fromType, toType); 168 : super._internal(rules, expression, fromType, toType);
169 169
170 @override 170 @override
171 String get name => 'STRONG_MODE_DOWN_CAST_COMPOSITE'; 171 String get name => 'STRONG_MODE_DOWN_CAST_COMPOSITE';
172 172
173 toErrorCode() => new StaticTypeWarningCode(name, message); 173 toErrorCode() => new StaticWarningCode(name, message);
174 } 174 }
175 175
176 /// A down cast to a non-ground type. These behave differently from standard 176 /// A down cast to a non-ground type. These behave differently from standard
177 /// Dart and may be more likely to fail at runtime. 177 /// Dart and may be more likely to fail at runtime.
178 class DownCastImplicit extends DownCast { 178 class DownCastImplicit extends DownCast {
179 DownCastImplicit(TypeSystem rules, Expression expression, DartType fromType, 179 DownCastImplicit(TypeSystem rules, Expression expression, DartType fromType,
180 DartType toType) 180 DartType toType)
181 : super._internal(rules, expression, fromType, toType); 181 : super._internal(rules, expression, fromType, toType);
182 182
183 @override 183 @override
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 super(expression); 539 super(expression);
540 540
541 @override 541 @override
542 List<Object> get arguments => [node, baseType, expectedType]; 542 List<Object> get arguments => [node, baseType, expectedType];
543 @override 543 @override
544 String get message => 'Type check failed: {0} ({1}) is not of type {2}'; 544 String get message => 'Type check failed: {0} ({1}) is not of type {2}';
545 545
546 @override 546 @override
547 String get name => 'STRONG_MODE_STATIC_TYPE_ERROR'; 547 String get name => 'STRONG_MODE_STATIC_TYPE_ERROR';
548 } 548 }
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