mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Strict keyword arguments: handle trailing closures harder.
Cope with lvalue types, optionals. Swift SVN r17416
This commit is contained in:
@@ -143,6 +143,13 @@ matchCallArguments(ConstraintSystem &cs,
|
||||
for (unsigned i = paramIdx; i != numParams; ++i) {
|
||||
const auto ¶m = paramTuple->getFields()[i];
|
||||
auto type = param.isVararg() ? param.getVarargBaseTy() : param.getType();
|
||||
type = type->getRValueInstanceType();
|
||||
|
||||
// Look through optionals.
|
||||
if (auto optValue = type->getAnyOptionalObjectType()) {
|
||||
type = optValue;
|
||||
}
|
||||
|
||||
auto funcTy = type->getAs<FunctionType>();
|
||||
if (!funcTy)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user