File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ using namespace swift::constraints;
24
24
bool ArgumentTypeCheckCompletionCallback::addPossibleParams (
25
25
const ArgumentTypeCheckCompletionCallback::Result &Res,
26
26
SmallVectorImpl<PossibleParamInfo> &Params, SmallVectorImpl<Type> &Types) {
27
- if (!Res.ParamIdx ) {
27
+ if (!Res.ParamIdx || !Res. FuncTy ) {
28
28
// We don't really know much here. Suggest global results without a specific
29
29
// expected type.
30
30
return true ;
@@ -118,6 +118,13 @@ void ArgumentTypeCheckCompletionCallback::sawSolutionImpl(const Solution &S) {
118
118
if (Info.Value && Info.Value ->shouldHideFromEditor ()) {
119
119
return ;
120
120
}
121
+ // Disallow invalid initializer references
122
+ for (auto Fix : S.Fixes ) {
123
+ if (Fix->getLocator () == CalleeLocator &&
124
+ Fix->getKind () == FixKind::AllowInvalidInitRef) {
125
+ return ;
126
+ }
127
+ }
121
128
122
129
// Find the parameter the completion was bound to (if any), as well as which
123
130
// parameters are already bound (so we don't suggest them even when the args
You can’t perform that action at this time.
0 commit comments