| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 import 'package:analyzer/analyzer.dart' as analyzer; | 5 import 'package:analyzer/analyzer.dart' as analyzer; |
| 6 import 'package:analyzer/dart/ast/ast.dart'; | 6 import 'package:analyzer/dart/ast/ast.dart'; |
| 7 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 7 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| 8 import 'package:analyzer/dart/element/type.dart' show DartType; | 8 import 'package:analyzer/dart/element/type.dart' show DartType; |
| 9 import 'package:analyzer/src/dart/ast/ast.dart' show FunctionBodyImpl; | 9 import 'package:analyzer/src/dart/ast/ast.dart' show FunctionBodyImpl; |
| 10 import 'package:analyzer/src/dart/ast/utilities.dart' show NodeReplacer; | 10 import 'package:analyzer/src/dart/ast/utilities.dart' show NodeReplacer; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 ResolutionCopier.copyResolutionData(node, copy); | 125 ResolutionCopier.copyResolutionData(node, copy); |
| 126 return copy; | 126 return copy; |
| 127 } | 127 } |
| 128 } | 128 } |
| 129 | 129 |
| 130 class _TreeCloner extends analyzer.AstCloner { | 130 class _TreeCloner extends analyzer.AstCloner { |
| 131 void _cloneProperties(AstNode clone, AstNode node) { | 131 void _cloneProperties(AstNode clone, AstNode node) { |
| 132 if (clone is Expression) { | 132 if (clone is Expression) { |
| 133 ast_properties.setImplicitCast( | 133 ast_properties.setImplicitCast( |
| 134 clone, ast_properties.getImplicitCast(node)); | 134 clone, ast_properties.getImplicitCast(node)); |
| 135 ast_properties.setImplicitOperationCast( |
| 136 clone, ast_properties.getImplicitOperationCast(node)); |
| 135 ast_properties.setIsDynamicInvoke( | 137 ast_properties.setIsDynamicInvoke( |
| 136 clone, ast_properties.isDynamicInvoke(node)); | 138 clone, ast_properties.isDynamicInvoke(node)); |
| 137 } | 139 } |
| 140 if (clone is ClassDeclaration) { |
| 141 ast_properties.setClassCovariantParameters( |
| 142 clone, ast_properties.getClassCovariantParameters(node)); |
| 143 ast_properties.setSuperclassCovariantParameters( |
| 144 clone, ast_properties.getSuperclassCovariantParameters(node)); |
| 145 } |
| 138 } | 146 } |
| 139 | 147 |
| 140 @override | 148 @override |
| 141 /*=E*/ cloneNode/*<E extends AstNode>*/(/*=E*/ node) { | 149 /*=E*/ cloneNode/*<E extends AstNode>*/(/*=E*/ node) { |
| 142 var clone = super.cloneNode(node); | 150 var clone = super.cloneNode(node); |
| 143 _cloneProperties(clone, node); | 151 _cloneProperties(clone, node); |
| 144 return clone; | 152 return clone; |
| 145 } | 153 } |
| 146 | 154 |
| 147 @override | 155 @override |
| (...skipping 25 matching lines...) Expand all Loading... |
| 173 | 181 |
| 174 // TODO(jmesserly): workaround for | 182 // TODO(jmesserly): workaround for |
| 175 // https://github.com/dart-lang/sdk/issues/26368 | 183 // https://github.com/dart-lang/sdk/issues/26368 |
| 176 @override | 184 @override |
| 177 TypeName visitTypeName(TypeName node) { | 185 TypeName visitTypeName(TypeName node) { |
| 178 var clone = super.visitTypeName(node); | 186 var clone = super.visitTypeName(node); |
| 179 clone.type = node.type; | 187 clone.type = node.type; |
| 180 return clone; | 188 return clone; |
| 181 } | 189 } |
| 182 } | 190 } |
| OLD | NEW |