Strict keyword arguments: handle trailing closures harder.

Cope with lvalue types, optionals.


Swift SVN r17416
This commit is contained in:
Doug Gregor
2014-05-05 03:40:23 +00:00
parent 545eb3be31
commit ecb7612797

View File

@@ -143,6 +143,13 @@ matchCallArguments(ConstraintSystem &cs,
for (unsigned i = paramIdx; i != numParams; ++i) {
const auto &param = 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;