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

Unified Diff: sdk/lib/_internal/compiler/implementation/typechecker.dart

Issue 47513007: Fix the more specific relation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase + fix test/status Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/typechecker.dart
diff --git a/sdk/lib/_internal/compiler/implementation/typechecker.dart b/sdk/lib/_internal/compiler/implementation/typechecker.dart
index 9aa6409e5d89c9dbe5428344afe2c79f9b314bc2..338258bfe1c5eeb165bb591aaf079de01eb4707d 100644
--- a/sdk/lib/_internal/compiler/implementation/typechecker.dart
+++ b/sdk/lib/_internal/compiler/implementation/typechecker.dart
@@ -933,21 +933,13 @@ class TypeCheckerVisitor extends Visitor<DartType> {
new TypePromotion(node, variable, shownType);
if (!types.isMoreSpecific(shownType, knownType)) {
String variableName = variable.name;
- if (types.isMoreSpecific(shownType.asRaw(), knownType)) {
- //trace('$node');
- typePromotion.addHint(node,
- MessageKind.NOT_MORE_SPECIFIC_RAW,
- {'variableName': variableName,
- 'shownType': shownType,
- 'knownType': knownType,
- 'shownTypeRaw': shownType.asRaw()});
- } else {
- typePromotion.addHint(node,
- MessageKind.NOT_MORE_SPECIFIC,
- {'variableName': variableName,
- 'shownType': shownType,
- 'knownType': knownType});
- }
+ // TODO(johnniwinther): Provide a how-to-fix in the case one tries
+ // to promote a generic type to a raw type.
+ typePromotion.addHint(node,
+ MessageKind.NOT_MORE_SPECIFIC,
+ {'variableName': variableName,
+ 'shownType': shownType,
+ 'knownType': knownType});
}
showTypePromotion(node, typePromotion);
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/dart_types.dart ('k') | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698