Skip to content

Commit f44926b

Browse files
committed
RequirementMachine: Tighten up createRequirementFromRule()
Now that the 'identity conformance' [P].[P] => [P] is permanent, we won't see it here, so we can just assume that any non-permanent, non-redundant rule maps to a requirement.
1 parent a8bc8a8 commit f44926b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/AST/RequirementMachine/RequirementMachineRequests.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,13 @@ RequirementMachine::buildRequirementSignature(ArrayRef<unsigned> rules,
154154
}
155155

156156
llvm_unreachable("Invalid symbol kind");
157-
} else if (rule.getLHS().back().getKind() != Symbol::Kind::Protocol) {
158-
auto constraintType = Context.getTypeForTerm(rule.getLHS(), genericParams);
159-
auto subjectType = Context.getTypeForTerm(rule.getRHS(), genericParams);
160-
161-
sameTypeReqs[subjectType.getPointer()].Members.push_back(constraintType);
162157
}
158+
159+
assert(rule.getLHS().back().getKind() != Symbol::Kind::Protocol);
160+
auto constraintType = Context.getTypeForTerm(rule.getLHS(), genericParams);
161+
auto subjectType = Context.getTypeForTerm(rule.getRHS(), genericParams);
162+
163+
sameTypeReqs[subjectType.getPointer()].Members.push_back(constraintType);
163164
};
164165

165166
if (getDebugOptions().contains(DebugFlags::Minimization)) {

0 commit comments

Comments
 (0)