Index: pkg/compiler/lib/src/ssa/builder.dart |
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart |
index 1a754fd18f29628daabe4c52d8651e26dd3bbd0d..330c86fedef58473f7ccfc9133561f7c1bb18b9e 100644 |
--- a/pkg/compiler/lib/src/ssa/builder.dart |
+++ b/pkg/compiler/lib/src/ssa/builder.dart |
@@ -2594,6 +2594,10 @@ class SsaBuilder extends ast.Visitor |
HInstruction buildTypeConversion( |
HInstruction original, DartType type, int kind) { |
if (type == null) return original; |
+ // TODO(eernst): The following statement was added for parsing and ignoring |
+ // method type variables; must be generalized for full support of generic |
+ // methods. |
+ type = type.eraseMethodTypeVariableType; |
type = type.unaliased; |
assert(assertTypeInContext(type, original)); |
if (type.isInterfaceType && !type.treatAsRaw) { |
@@ -4772,6 +4776,17 @@ class SsaBuilder extends ast.Visitor |
// The type variable is stored on the object. |
return readTypeVariable(member.enclosingClass, type.element, |
sourceInformation: sourceInformation); |
+ } else if (type is MethodTypeVariableType) { |
Johnni Winther
2016/05/17 10:27:05
When is this used?
eernst
2016/05/17 14:48:54
I believe that it is not used any more: with the n
|
+ // TODO(eernst): The enclosing `else if` was added to provide minimal |
+ // support for generic methods: The method type arguments are always |
+ // pretending to have the value `dynamic`. Revise for full support. |
+ DynamicType type = const DynamicType(); |
+ JavaScriptBackend backend = compiler.backend; |
+ ClassElement cls = backend.helpers.DynamicRuntimeType; |
+ HInstruction instruction = |
+ new HDynamicType(type, new TypeMask.exact(cls, compiler.world)); |
+ add(instruction); |
+ return instruction; |
} else { |
reporter.internalError( |
type.element, 'Unexpected type variable in static context.'); |