Replace assertTypeParameterType() with the display string check.
Not that we include the promoted bound in the display string,
we can get back to checking these types just as strings.
R=brianwilkerson@google.com
Change-Id: Ie713e18082a3f5080ece039573098c998b8a2b98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165863
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
index be98561..a51df3a 100644
--- a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
@@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:analyzer/dart/element/type.dart';
import 'package:analyzer/src/error/codes.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -34,13 +33,9 @@
''');
- var creation = findNode.instanceCreation('A(s)');
- var creationType = creation.staticType as InterfaceType;
-
- assertTypeParameterType(
- creationType.typeArguments[0],
- element: findElement.typeParameter('S'),
- promotedBound: null,
+ assertType(
+ findNode.instanceCreation('A(s)'),
+ 'A<S>',
);
}
diff --git a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
index 5c49601..16de782 100644
--- a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
@@ -405,10 +405,9 @@
''');
- assertTypeParameterType(
- findNode.methodInvocation('test(s)').typeArgumentTypes[0],
- element: findElement.typeParameter('S'),
- promotedBound: null,
+ assertTypeArgumentTypes(
+ findNode.methodInvocation('test(s)'),
+ ['S'],
);
}
diff --git a/pkg/analyzer/test/src/dart/resolution/resolution.dart b/pkg/analyzer/test/src/dart/resolution/resolution.dart
index 011e60f..2fdf8ba 100644
--- a/pkg/analyzer/test/src/dart/resolution/resolution.dart
+++ b/pkg/analyzer/test/src/dart/resolution/resolution.dart
@@ -776,15 +776,6 @@
expect(node.staticType, isNull);
}
- void assertTypeParameterType(
- TypeParameterTypeImpl type, {
- @required TypeParameterElement element,
- @required String promotedBound,
- }) {
- assertElement(type.element, element);
- assertType(type.promotedBound, promotedBound);
- }
-
Matcher elementMatcher(
Element declaration, {
bool isLegacy = false,