Skip to content

Commit 0580357

Browse files
authored
Merge pull request swiftlang#38044 from rintaro/ide-completion-rdar79092374
[CodeCompletion] Allow unresolved types in Callee analysis
2 parents ad14730 + 013333b commit 0580357

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/IDE/ExprContextAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ static bool collectPossibleCalleesForApply(
688688
fnType = *fnTypeOpt;
689689
}
690690

691-
if (!fnType || fnType->hasUnresolvedType() || fnType->hasError())
691+
if (!fnType || fnType->hasError())
692692
return false;
693693
fnType = fnType->getWithoutSpecifierType();
694694

test/IDE/complete_call_arg.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,3 +998,20 @@ struct Rdar77867723 {
998998
// OVERLOAD_LABEL2: End completions
999999
}
10001000
}
1001+
1002+
struct SR14737<T> {
1003+
init(arg1: T, arg2: Bool) {}
1004+
}
1005+
extension SR14737 where T == Int {
1006+
init(arg1: T, onlyInt: Bool) {}
1007+
}
1008+
func test_SR14737() {
1009+
invalidCallee {
1010+
SR14737(arg1: true, #^GENERIC_INIT_IN_INVALID^#)
1011+
// FIXME: 'onlyInt' shouldn't be offered because 'arg1' is Bool.
1012+
// GENERIC_INIT_IN_INVALID: Begin completions, 2 items
1013+
// GENERIC_INIT_IN_INVALID-DAG: Pattern/Local/Flair[ArgLabels]: {#arg2: Bool#}[#Bool#];
1014+
// GENERIC_INIT_IN_INVALID-DAG: Pattern/Local/Flair[ArgLabels]: {#onlyInt: Bool#}[#Bool#];
1015+
// GENERIC_INIT_IN_INVALID: End completions
1016+
}
1017+
}

0 commit comments

Comments
 (0)