Skip to content

Commit 9c2d540

Browse files
committed
RequirementMachine: Check invariants using GenericSignature::verify()
Previously only the GenericSignatureBuilder would call this; to ensure we get the same test coverage when the Requirement Machine is 'on' as 'verify', also call this from the Requirement Machine. For now, we can't call this from RequirementSignatureRequestRQM due to circularity issues; that will have to wait until this request is folded into RequirementSignatureRequest.
1 parent 6c32830 commit 9c2d540

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/AST/RequirementMachine/RequirementMachineRequests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,9 @@ AbstractGenericSignatureRequestRQM::evaluate(
524524
auto result = GenericSignature::get(genericParams, minimalRequirements);
525525
bool hadError = machine->hadError();
526526

527+
if (!hadError)
528+
result.verify();
529+
527530
return GenericSignatureWithError(result, hadError);
528531
}
529532

@@ -669,5 +672,9 @@ InferredGenericSignatureRequestRQM::evaluate(
669672

670673
// FIXME: Handle allowConcreteGenericParams
671674

675+
// Check invariants.
676+
if (!hadError)
677+
result.verify();
678+
672679
return GenericSignatureWithError(result, hadError);
673680
}

0 commit comments

Comments
 (0)