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

Unified Diff: tests/compiler/dart2js/kernel/impact_test.dart

Issue 2879593004: Reorganize equivalence test helpers (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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/kernel/impact_test.dart
diff --git a/tests/compiler/dart2js/kernel/impact_test.dart b/tests/compiler/dart2js/kernel/impact_test.dart
index c83c47272889805dad42a5aeb02a188c34b6ab54..32a8303f510601942ee0275ea373f1dae325ea03 100644
--- a/tests/compiler/dart2js/kernel/impact_test.dart
+++ b/tests/compiler/dart2js/kernel/impact_test.dart
@@ -26,7 +26,8 @@ import 'package:compiler/src/universe/use.dart';
import 'package:expect/expect.dart';
import 'package:kernel/ast.dart' as ir;
import '../memory_compiler.dart';
-import '../serialization/test_helper.dart';
+import '../equivalence/check_helpers.dart';
+import 'test_helpers.dart';
const Map<String, String> SOURCE = const <String, String>{
// Pretend this is a dart2js_native test to allow use of 'native' keyword.
@@ -904,45 +905,3 @@ ResolutionImpact laxImpact(
impact.nativeData.forEach(builder.registerNativeData);
return builder;
}
-
-/// Visitor the performers unaliasing of all typedefs nested within a
-/// [ResolutionDartType].
-class Unaliaser
- extends BaseResolutionDartTypeVisitor<dynamic, ResolutionDartType> {
- const Unaliaser();
-
- @override
- ResolutionDartType visit(ResolutionDartType type, [_]) =>
- type.accept(this, null);
-
- @override
- ResolutionDartType visitType(ResolutionDartType type, _) => type;
-
- List<ResolutionDartType> visitList(List<ResolutionDartType> types) =>
- types.map(visit).toList();
-
- @override
- ResolutionDartType visitInterfaceType(ResolutionInterfaceType type, _) {
- return type.createInstantiation(visitList(type.typeArguments));
- }
-
- @override
- ResolutionDartType visitTypedefType(ResolutionTypedefType type, _) {
- return visit(type.unaliased);
- }
-
- @override
- ResolutionDartType visitFunctionType(ResolutionFunctionType type, _) {
- return new ResolutionFunctionType.synthesized(
- visit(type.returnType),
- visitList(type.parameterTypes),
- visitList(type.optionalParameterTypes),
- type.namedParameters,
- visitList(type.namedParameterTypes));
- }
-}
-
-/// Perform unaliasing of all typedefs nested within a [ResolutionDartType].
-ResolutionDartType unalias(ResolutionDartType type) {
- return const Unaliaser().visit(type);
-}

Powered by Google App Engine
This is Rietveld 408576698