[cfe] Use more precise types for FunctionInvocation and LocalFunctionInvocation in type checker

Issue: https://github.com/dart-lang/sdk/issues/45340
Change-Id: I963b3a3b1143a9fbd0eac700daa11488aa5b183a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/198182
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Alexander Markov 2021-05-05 23:31:56 +00:00 committed by commit-bot@chromium.org
parent 5c0ff97acf
commit df3bb63a13

View file

@ -1122,8 +1122,7 @@ class TypeCheckingVisitor
node.arguments.positional.forEach(visitExpression);
node.arguments.named
.forEach((NamedExpression n) => visitExpression(n.value));
// TODO(johnniwinther): Return the correct result type.
return const DynamicType();
return node.functionType?.returnType ?? const DynamicType();
}
@override
@ -1190,8 +1189,7 @@ class TypeCheckingVisitor
node.arguments.positional.forEach(visitExpression);
node.arguments.named
.forEach((NamedExpression n) => visitExpression(n.value));
// TODO(johnniwinther): Return the correct result type.
return const DynamicType();
return node.functionType.returnType;
}
@override