[ConstraintSystem] Lift a restriction on fixing of non-function calls on Any/AnyObject

Detect and diagnose situations where call is attempted directly on
`Any` or `AnyObject` or member calls with `AnyObject` base which
didn't match.
This commit is contained in:
Pavel Yaskevich
2019-12-13 14:04:26 -08:00
parent a9106cafca
commit d77e34925f
2 changed files with 13 additions and 5 deletions

View File

@@ -7520,11 +7520,6 @@ ConstraintSystem::simplifyApplicableFnConstraint(
desugar2->is<AnyMetatypeType>())
return SolutionKind::Error;
if (auto objectTy = desugar2->lookThroughAllOptionalTypes()) {
if (objectTy->isAny() || objectTy->isAnyObject())
return SolutionKind::Error;
}
// If there are any type variables associated with arguments/result
// they have to be marked as "holes".
type1.visit([&](Type subType) {