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

Unified Diff: pkg/analyzer/lib/src/generated/static_type_analyzer.dart

Issue 1678313002: fix part of #25200, reject non-generic function subtype of generic function (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix synthetic ctor Created 4 years, 10 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
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index fa2bf1c4027e2e106f94caff586670f73d5e0ead..b788f13677fc66e1d23035f1c05ba154501f81fc 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -477,11 +477,16 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
DartType functionType = InferenceContext.getType(node);
if (functionType is FunctionType) {
- DartType returnType = functionType.returnType;
- if (computedType.isDynamic &&
- !(returnType.isDynamic || returnType.isBottom)) {
- computedType = returnType;
- _resolver.inferenceContext.recordInference(node, functionType);
+ functionType = _resolver.matchFunctionTypeParameters(
+ node.typeParameters, functionType);
+
+ if (functionType is FunctionType) {
+ DartType returnType = functionType.returnType;
+ if (computedType.isDynamic &&
+ !(returnType.isDynamic || returnType.isBottom)) {
+ computedType = returnType;
+ _resolver.inferenceContext.recordInference(node, functionType);
+ }
}
}
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/type_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698