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

Side by Side Diff: pkg/kernel/lib/transformations/reify/transformation/remove_generics.dart

Issue 2849803002: Revert "Add typedef AST node boilerplate." (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « pkg/kernel/lib/text/ast_to_text.dart ('k') | pkg/kernel/lib/transformations/treeshaker.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/text/ast_to_text.dart ('k') | pkg/kernel/lib/transformations/treeshaker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698