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 |
63 Supertype visitSupertype(Supertype type) { | 68 Supertype visitSupertype(Supertype type) { |
64 if (removeTypeParameters(type.classNode)) { | 69 if (removeTypeParameters(type.classNode)) { |
65 return new Supertype(type.classNode, const <DartType>[]); | 70 return new Supertype(type.classNode, const <DartType>[]); |
66 } | 71 } |
67 return type; | 72 return type; |
68 } | 73 } |
69 | 74 |
70 @override | 75 @override |
71 FunctionType visitFunctionType(FunctionType type) { | 76 FunctionType visitFunctionType(FunctionType type) { |
72 bool partHasChanged = false; | 77 bool partHasChanged = false; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 134 } |
130 return node; | 135 return node; |
131 } | 136 } |
132 | 137 |
133 @override | 138 @override |
134 Expression visitMethodInvocation(MethodInvocation node) { | 139 Expression visitMethodInvocation(MethodInvocation node) { |
135 node.transformChildren(this); | 140 node.transformChildren(this); |
136 return removeTypeArgumentOfMethodInvocation(node); | 141 return removeTypeArgumentOfMethodInvocation(node); |
137 } | 142 } |
138 } | 143 } |
OLD | NEW |