Sema: remove unnecessary special case for dynamic method lookup

This commit is contained in:
Slava Pestov
2017-08-01 21:16:22 -07:00
parent 0b9ad51a46
commit db3c74c2a2

View File

@@ -1279,12 +1279,6 @@ ConstraintSystem::getTypeOfMemberReference(
// For a static member referenced through a metatype or an instance
// member referenced through an instance, strip off the 'self'.
type = openedFnType->getResult();
} else if (isDynamicResult && isa<AbstractFunctionDecl>(value)) {
// For a dynamic result referring to an instance function through
// an object of metatype type, replace the 'Self' parameter with
// a AnyObject member.
auto anyObjectTy = TC.Context.getAnyObjectType();
type = openedFnType->replaceSelfParameterType(anyObjectTy);
} else {
// For an unbound instance method reference, replace the 'Self'
// parameter with the base type.