[ConstraintSystem] Enforce TVO_CanBindToPack, and diagnose pack references outside

of pack expansion expressions.
This commit is contained in:
Holly Borla
2023-03-20 20:04:39 -07:00
parent 6c5ac5179a
commit cb19fc3a71
9 changed files with 124 additions and 9 deletions

View File

@@ -6146,6 +6146,12 @@ bool InvalidPackElement::diagnoseAsError() {
return true;
}
bool InvalidPackReference::diagnoseAsError() {
emitDiagnostic(diag::pack_reference_outside_expansion,
packType, /*inExpression*/true);
return true;
}
bool CollectionElementContextualFailure::diagnoseAsError() {
auto anchor = getRawAnchor();
auto *locator = getLocator();