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.
This commit is contained in:
Slava Pestov
2022-03-03 09:55:01 -05:00
parent 6c3283059a
commit 9c2d540e69

View File

@@ -524,6 +524,9 @@ AbstractGenericSignatureRequestRQM::evaluate(
auto result = GenericSignature::get(genericParams, minimalRequirements);
bool hadError = machine->hadError();
if (!hadError)
result.verify();
return GenericSignatureWithError(result, hadError);
}
@@ -669,5 +672,9 @@ InferredGenericSignatureRequestRQM::evaluate(
// FIXME: Handle allowConcreteGenericParams
// Check invariants.
if (!hadError)
result.verify();
return GenericSignatureWithError(result, hadError);
}