File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -5598,6 +5598,19 @@ bool ExtraneousCallFailure::diagnoseAsError() {
5598
5598
}
5599
5599
}
5600
5600
5601
+ if (auto *UDE = dyn_cast<UnresolvedDotExpr>(anchor)) {
5602
+ auto *baseExpr = UDE->getBase ();
5603
+ auto *call = cast<CallExpr>(getRawAnchor ());
5604
+
5605
+ if (getType (baseExpr)->isAnyObject ()) {
5606
+ emitDiagnostic (anchor->getLoc (), diag::cannot_call_with_params,
5607
+ UDE->getName ().getBaseName ().userFacingName (),
5608
+ getType (call->getArg ())->getString (),
5609
+ isa<TypeExpr>(baseExpr));
5610
+ return true ;
5611
+ }
5612
+ }
5613
+
5601
5614
auto diagnostic = emitDiagnostic (
5602
5615
anchor->getLoc (), diag::cannot_call_non_function_value, getType (anchor));
5603
5616
removeParensFixIt (diagnostic);
Original file line number Diff line number Diff line change @@ -7520,11 +7520,6 @@ ConstraintSystem::simplifyApplicableFnConstraint(
7520
7520
desugar2->is <AnyMetatypeType>())
7521
7521
return SolutionKind::Error;
7522
7522
7523
- if (auto objectTy = desugar2->lookThroughAllOptionalTypes ()) {
7524
- if (objectTy->isAny () || objectTy->isAnyObject ())
7525
- return SolutionKind::Error;
7526
- }
7527
-
7528
7523
// If there are any type variables associated with arguments/result
7529
7524
// they have to be marked as "holes".
7530
7525
type1.visit ([&](Type subType) {
You can’t perform that action at this time.
0 commit comments