We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f32cb61 commit b5568e0Copy full SHA for b5568e0
lib/Sema/CSGen.cpp
@@ -2191,8 +2191,12 @@ namespace {
2191
auto declaredTy = param->getType();
2192
externalType = CS.openUnboundGenericType(declaredTy, paramLoc);
2193
} else {
2194
+ // Let's allow parameters which haven't been explicitly typed
2195
+ // to become holes by default, this helps in situations like
2196
+ // `foo { a in }` where `foo` doesn't exist.
2197
externalType = CS.createTypeVariable(
- paramLoc, TVO_CanBindToInOut | TVO_CanBindToNoEscape);
2198
+ paramLoc,
2199
+ TVO_CanBindToInOut | TVO_CanBindToNoEscape | TVO_CanBindToHole);
2200
}
2201
2202
closureParams.push_back(param->toFunctionParam(externalType));
0 commit comments