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

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

Issue 12389025: Do not register typechecks against type variables of typedefs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add a helper. Created 7 years, 10 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/dart_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_types.dart b/sdk/lib/_internal/compiler/implementation/dart_types.dart
index ec79917d6858c80dbf36c8320d8d9f55d2e20c33..a289a58c52bd2c25688d9dafc26ff1730b0690e2 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_types.dart
@@ -994,6 +994,10 @@ class Types {
return subtypeVisitor.isAssignable(r, s);
}
+ static bool isTypeVariableOfTypedef(DartType type) {
+ return type.kind == TypeKind.TYPE_VARIABLE &&
+ type.element.enclosingElement.isTypedef();
+ }
/**
* Helper method for performing substitution of a linked list of types.

Powered by Google App Engine
This is Rietveld 408576698