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

Unified Diff: pkg/analyzer/test/src/task/strong_mode_test.dart

Issue 1364353003: [analyzer] copy generic type args when inferring a new function type for an ExecutableElement (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/src/task/strong_mode_test.dart
diff --git a/pkg/analyzer/test/src/task/strong_mode_test.dart b/pkg/analyzer/test/src/task/strong_mode_test.dart
index b143a8355db7ecda72397a721780510e98e55874..b8be53957449b9f85e9914877c87e86dd70bdfe1 100644
--- a/pkg/analyzer/test/src/task/strong_mode_test.dart
+++ b/pkg/analyzer/test/src/task/strong_mode_test.dart
@@ -707,13 +707,17 @@ class C<E> implements A<E> {
}
''');
ClassElement classC = unit.getType('C');
+ DartType typeCE = classC.typeParameters[0].type;
MethodElement methodC = classC.getMethod(methodName);
ParameterElement parameterC = methodC.parameters[0];
expect(parameterC.type.isDynamic, isTrue);
+ expect(methodC.type.typeArguments, [typeCE]);
inferrer.inferCompilationUnit(unit);
expect(parameterC.type, classC.typeParameters[0].type);
+ expect(methodC.type.typeArguments, [typeCE],
Jennifer Messerly 2015/09/24 22:35:56 this check was failing without the fix.
+ reason: 'function type should still have type arguments');
}
void test_inferCompilationUnit_method_return_multiple_different() {
@@ -917,12 +921,16 @@ class B<E> extends A<E> {
}
''');
ClassElement classB = unit.getType('B');
+ DartType typeBE = classB.typeParameters[0].type;
MethodElement methodB = classB.getMethod(methodName);
expect(methodB.returnType.isDynamic, isTrue);
+ expect(methodB.type.typeArguments, [typeBE]);
inferrer.inferCompilationUnit(unit);
expect(methodB.returnType, classB.typeParameters[0].type);
+ expect(methodB.type.typeArguments, [typeBE],
+ reason: 'function type should still have type arguments');
}
}
« pkg/analyzer/lib/src/task/strong_mode.dart ('K') | « pkg/analyzer/lib/src/task/strong_mode.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698