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

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

Issue 2825053002: Add typedef AST node boilerplate. (Closed)
Patch Set: Update FastaVerifyingVisitor to work with the changes in VerifyingVisitor 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
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
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 }
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