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

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

Issue 2115173002: fix #25220, infer generic type from constructor arguments (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: update tests to be AST summary friendly Created 4 years, 5 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/type_system_test.dart
diff --git a/pkg/analyzer/test/generated/type_system_test.dart b/pkg/analyzer/test/generated/type_system_test.dart
index c164540b88552dd8aeabf1b6ca6713ddad06a42d..d82d13572d656c025ed7b187c3e685028ee6a650 100644
--- a/pkg/analyzer/test/generated/type_system_test.dart
+++ b/pkg/analyzer/test/generated/type_system_test.dart
@@ -891,9 +891,7 @@ class StrongGenericFunctionInferenceTest {
expect(_inferCall(clone, [foo.type, foo.type]), [foo.type]);
// Something invalid...
- expect(_inferCall(clone, [stringType, numType]), [
- clonable.type.instantiate([dynamicType])
- ]);
+ expect(_inferCall(clone, [stringType, numType]), null);
}
void test_genericCastFunction() {
@@ -1007,7 +1005,7 @@ class StrongGenericFunctionInferenceTest {
// <T extends num>() -> T
var t = TypeBuilder.variable('T', bound: numType);
var f = TypeBuilder.function(types: [t], required: [], result: t);
- expect(_inferCall(f, [], stringType), [numType]);
+ expect(_inferCall(f, [], stringType), null);
}
void test_unifyParametersToFunctionParam() {
@@ -1024,7 +1022,7 @@ class StrongGenericFunctionInferenceTest {
TypeBuilder.function(required: [intType], result: dynamicType),
TypeBuilder.function(required: [doubleType], result: dynamicType)
]),
- [dynamicType]);
+ null);
}
void test_unusedReturnTypeIsDynamic() {
@@ -1045,7 +1043,7 @@ class StrongGenericFunctionInferenceTest {
[DartType returnType]) {
FunctionType inferred = typeSystem.inferGenericFunctionCall(typeProvider,
ft, ft.parameters.map((p) => p.type).toList(), arguments, returnType);
- return inferred.typeArguments;
+ return inferred?.typeArguments;
}
}
« no previous file with comments | « pkg/analyzer/test/generated/strong_mode_test.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698