[Sema] Don't assume member refs have base types

- Add a precondition on `doesDeclRefApplyCurriedSelf` to expect
a member decl, and rename it to make the precondition explicit.

- Don't assume that not having a base type means this isn't a member
reference, as member references to static operators don't have base
types.

Resolves SR-10843.
This commit is contained in:
Hamish Knight
2019-06-06 15:58:46 +01:00
parent 623a6adee0
commit 356b3b4150
4 changed files with 28 additions and 13 deletions

View File

@@ -1222,7 +1222,7 @@ ConstraintSystem::getTypeOfMemberReference(
// Check to see if the self parameter is applied, in which case we'll want to
// strip it off later.
auto hasAppliedSelf = doesDeclRefApplyCurriedSelf(baseObjTy, value);
auto hasAppliedSelf = doesMemberRefApplyCurriedSelf(baseObjTy, value);
baseObjTy = baseObjTy->getMetatypeInstanceType();
FunctionType::Param baseObjParam(baseObjTy);