Skip to content

Commit ece883c

Browse files
authored
Merge pull request #37589 from xedin/asserts-for-contextual-failure
[Diagnostics] NFC: Add asserts to verify from/to types in contextual …
2 parents 109d6c5 + 2a5eea6 commit ece883c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Sema/CSDiagnostics.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,10 @@ class ContextualFailure : public FailureDiagnostic {
608608
ContextualFailure(const Solution &solution, ContextualTypePurpose purpose,
609609
Type lhs, Type rhs, ConstraintLocator *locator)
610610
: FailureDiagnostic(solution, locator), CTP(purpose), RawFromType(lhs),
611-
RawToType(rhs) {}
611+
RawToType(rhs) {
612+
assert(lhs && "Expected a valid 'from' type");
613+
assert(rhs && "Expected a valid 'to' type");
614+
}
612615

613616
SourceLoc getLoc() const override;
614617

0 commit comments

Comments
 (0)