mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user