[ConstraintSystem] Fix isPartialApplication to properly handle static members

Only instance members require double-apply to be fully applied,
static members apply the base implicitly.
This commit is contained in:
Pavel Yaskevich
2023-11-29 17:00:13 -08:00
parent bd4ee4681b
commit a8232123c9
2 changed files with 26 additions and 1 deletions

View File

@@ -2469,7 +2469,10 @@ bool ConstraintSystem::isPartialApplication(ConstraintLocator *locator) {
auto baseTy =
simplifyType(getType(UDE->getBase()))->getWithoutSpecifierType();
return getApplicationLevel(*this, baseTy, UDE) < 2;
auto level = getApplicationLevel(*this, baseTy, UDE);
// Static members have base applied implicitly which means that their
// application level is lower.
return level < (baseTy->is<MetatypeType>() ? 1 : 2);
}
DeclReferenceType