[CS] Account for implicit returns in closures

Avoid defaulting to Void if we have an implicit
return from which we can infer the result type.
This commit is contained in:
Hamish Knight
2024-02-07 18:12:49 +00:00
parent 1003b2f30b
commit 33cdd33f9e
6 changed files with 15 additions and 20 deletions

View File

@@ -6460,9 +6460,9 @@ bool isTypeErasedKeyPathType(Type type);
/// `{Writable, ReferenceWritable}KeyPath`.
bool isKnownKeyPathDecl(ASTContext &ctx, ValueDecl *decl);
/// Determine whether given closure has any explicit `return`
/// Determine whether given closure has any `return`
/// statements that could produce non-void result.
bool hasExplicitResult(ClosureExpr *closure);
bool hasResultExpr(ClosureExpr *closure);
/// Emit diagnostics for syntactic restrictions within a given solution
/// application target.