| Index: lib/transformations/erasure.dart
|
| diff --git a/lib/transformations/erasure.dart b/lib/transformations/erasure.dart
|
| index a7aa8d87e9a830e4862ba9f23e92b7968cf42e52..d2cb413e9e994b17ccca167f626badcb1cb39fe5 100644
|
| --- a/lib/transformations/erasure.dart
|
| +++ b/lib/transformations/erasure.dart
|
| @@ -76,13 +76,19 @@ class Erasure extends Transformer {
|
| return node;
|
| }
|
|
|
| + bool isObject(DartType type) {
|
| + return type is InterfaceType && type.classNode.supertype == null;
|
| + }
|
| +
|
| @override
|
| visitFunctionNode(FunctionNode node) {
|
| for (var parameter in node.typeParameters) {
|
| substitution[parameter] = const DynamicType();
|
| }
|
| for (var parameter in node.typeParameters) {
|
| - substitution[parameter] = substitute(parameter.bound, substitution);
|
| + if (!isObject(parameter.bound)) {
|
| + substitution[parameter] = substitute(parameter.bound, substitution);
|
| + }
|
| }
|
| node.transformChildren(this);
|
| node.typeParameters.forEach(substitution.remove);
|
|
|