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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 12463012: Add a test and improve comment on generic checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/generic_is_check_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (revision 19551)
+++ sdk/lib/_internal/compiler/implementation/ssa/optimize.dart (working copy)
@@ -541,7 +541,10 @@
} else {
return graph.addConstantBool(false, constantSystem);
}
- // TODO(karlklose): remove the hasTypeArguments check.
+ // Wee need the [:hasTypeArguments:] check because we don't have
+ // the notion of generics in the backend. For example, [:this:] in
+ // a class [:A<T>:], is currently always considered to have the
+ // raw type.
} else if (expressionType.isUseful()
&& !expressionType.canBeNull()
&& !RuntimeTypeInformation.hasTypeArguments(type)) {
@@ -549,7 +552,7 @@
if (receiverType != null) {
if (!receiverType.isMalformed &&
!type.isMalformed &&
- compiler.types.isSubtype(receiverType, type)) {
+ compiler.types.isSubtype(receiverType.element.rawType, type)) {
return graph.addConstantBool(true, constantSystem);
} else if (expressionType.isExact()) {
return graph.addConstantBool(false, constantSystem);
« no previous file with comments | « no previous file | tests/language/generic_is_check_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698