[AST] Remove more interface-type redundancy from ProtocolConformance.

This commit is contained in:
Doug Gregor
2017-04-18 17:14:40 -07:00
parent 4da11aab58
commit d9af96ffe4
4 changed files with 4 additions and 11 deletions

View File

@@ -1805,19 +1805,16 @@ void swift::maybeAddAccessorsToVariable(VarDecl *var, TypeChecker &TC) {
// The conformance will be on the containing 'self' type, or '()' if the
// property is in a non-type context.
Type behaviorSelf;
Type behaviorInterfaceSelf;
if (dc->isTypeContext()) {
behaviorInterfaceSelf = dc->getSelfInterfaceType();
behaviorSelf = dc->mapTypeIntoContext(behaviorInterfaceSelf);
behaviorSelf = dc->getSelfTypeInContext();
assert(behaviorSelf && "type context doesn't have self type?!");
if (var->isStatic())
behaviorSelf = MetatypeType::get(behaviorSelf);
} else {
behaviorSelf = behaviorInterfaceSelf = TC.Context.TheEmptyTupleType;
behaviorSelf = TC.Context.TheEmptyTupleType;
}
conformance = TC.Context.getBehaviorConformance(behaviorSelf,
behaviorInterfaceSelf,
behaviorProto,
behavior->getLoc(), var,
ProtocolConformanceState::Checking);