mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[code-completion] Handle func-reference syntax for optional expected type
The underlying type-check was correct, but I forgot to consider it in the outer code, and embarassingly never tested this case. rdar://problem/28435922
This commit is contained in:
@@ -1652,7 +1652,9 @@ private:
|
||||
return true;
|
||||
bool isImplicitlyCurriedIM = isImplicitlyCurriedInstanceMethod(D);
|
||||
for (auto expectedType : ExpectedTypes) {
|
||||
if (expectedType && expectedType->is<AnyFunctionType>() &&
|
||||
if (expectedType &&
|
||||
expectedType->lookThroughAllAnyOptionalTypes()
|
||||
->is<AnyFunctionType>() &&
|
||||
calculateTypeRelationForDecl(D, expectedType, isImplicitlyCurriedIM,
|
||||
/*UseFuncResult=*/false) >=
|
||||
CodeCompletionResult::ExpectedTypeRelation::Convertible) {
|
||||
|
||||
Reference in New Issue
Block a user