| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library kernel.transformations.reify.transformation.remove_generics; | 5 library kernel.transformations.reify.transformation.remove_generics; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart'; | 7 import 'package:kernel/ast.dart'; |
| 8 import 'transformer.dart'; | 8 import 'transformer.dart'; |
| 9 | 9 |
| 10 class Erasure extends Transformer with DartTypeVisitor<DartType> { | 10 class Erasure extends Transformer with DartTypeVisitor<DartType> { |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 @override | 54 @override |
| 55 InterfaceType visitInterfaceType(InterfaceType type) { | 55 InterfaceType visitInterfaceType(InterfaceType type) { |
| 56 if (removeTypeParameters(type.classNode)) { | 56 if (removeTypeParameters(type.classNode)) { |
| 57 return new InterfaceType(type.classNode, const <DartType>[]); | 57 return new InterfaceType(type.classNode, const <DartType>[]); |
| 58 } | 58 } |
| 59 return type; | 59 return type; |
| 60 } | 60 } |
| 61 | 61 |
| 62 @override | 62 @override |
| 63 TypedefType visitTypedefType(TypedefType type) { | |
| 64 throw 'Typedef types not implemented in erasure'; | |
| 65 } | |
| 66 | |
| 67 @override | |
| 68 Supertype visitSupertype(Supertype type) { | 63 Supertype visitSupertype(Supertype type) { |
| 69 if (removeTypeParameters(type.classNode)) { | 64 if (removeTypeParameters(type.classNode)) { |
| 70 return new Supertype(type.classNode, const <DartType>[]); | 65 return new Supertype(type.classNode, const <DartType>[]); |
| 71 } | 66 } |
| 72 return type; | 67 return type; |
| 73 } | 68 } |
| 74 | 69 |
| 75 @override | 70 @override |
| 76 FunctionType visitFunctionType(FunctionType type) { | 71 FunctionType visitFunctionType(FunctionType type) { |
| 77 bool partHasChanged = false; | 72 bool partHasChanged = false; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 } | 129 } |
| 135 return node; | 130 return node; |
| 136 } | 131 } |
| 137 | 132 |
| 138 @override | 133 @override |
| 139 Expression visitMethodInvocation(MethodInvocation node) { | 134 Expression visitMethodInvocation(MethodInvocation node) { |
| 140 node.transformChildren(this); | 135 node.transformChildren(this); |
| 141 return removeTypeArgumentOfMethodInvocation(node); | 136 return removeTypeArgumentOfMethodInvocation(node); |
| 142 } | 137 } |
| 143 } | 138 } |
| OLD | NEW |