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

Unified Diff: pkg/analyzer/test/generated/resolver_test_case.dart

Issue 2621433003: fixes #28236, generic methods should not cause warnings in Dart 1 (Closed)
Patch Set: test type annotation fix Created 3 years, 11 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: pkg/analyzer/test/generated/resolver_test_case.dart
diff --git a/pkg/analyzer/test/generated/resolver_test_case.dart b/pkg/analyzer/test/generated/resolver_test_case.dart
index 8de57ce55844882d0492afa4de271244bfd13390..e79552500959249b4bffeef443eb67c1346d5f2e 100644
--- a/pkg/analyzer/test/generated/resolver_test_case.dart
+++ b/pkg/analyzer/test/generated/resolver_test_case.dart
@@ -752,11 +752,14 @@ class StaticTypeAnalyzer2TestShared extends ResolverTestCase {
* stringifies to [type] and that its generics match the given stringified
* output.
*/
- expectFunctionType(String name, String type,
+ FunctionTypeImpl expectFunctionType(String name, String type,
{String elementTypeParams: '[]',
String typeParams: '[]',
String typeArgs: '[]',
- String typeFormals: '[]'}) {
+ String typeFormals: '[]',
+ String identifierType}) {
+ identifierType ??= type;
+
typeParameters(Element element) {
if (element is ExecutableElement) {
return element.typeParameters;
@@ -768,13 +771,15 @@ class StaticTypeAnalyzer2TestShared extends ResolverTestCase {
SimpleIdentifier identifier = findIdentifier(name);
// Element is either ExecutableElement or ParameterElement.
- Element element = identifier.staticElement;
- FunctionTypeImpl functionType = identifier.staticType;
+ var element = identifier.staticElement;
+ FunctionTypeImpl functionType = (element as dynamic).type;
expect(functionType.toString(), type);
+ expect(identifier.staticType.toString(), identifierType);
expect(typeParameters(element).toString(), elementTypeParams);
expect(functionType.typeParameters.toString(), typeParams);
expect(functionType.typeArguments.toString(), typeArgs);
expect(functionType.typeFormals.toString(), typeFormals);
+ return functionType;
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | pkg/analyzer/test/generated/static_type_analyzer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698