@@ -351,9 +351,11 @@ class MissingConformanceFailure final : public RequirementFailure {
351
351
std::pair<Type, Type> conformance)
352
352
: RequirementFailure(solution, conformance.first, conformance.second,
353
353
locator) {
354
+ #ifndef NDEBUG
354
355
auto reqElt = locator->castLastElementTo <LocatorPathElt::AnyRequirement>();
355
356
assert (reqElt.getRequirementKind () == RequirementKind::Conformance ||
356
357
reqElt.getRequirementKind () == RequirementKind::Layout);
358
+ #endif
357
359
}
358
360
359
361
bool diagnoseAsError () override ;
@@ -408,8 +410,10 @@ class SameTypeRequirementFailure final : public RequirementFailure {
408
410
SameTypeRequirementFailure (const Solution &solution, Type lhs, Type rhs,
409
411
ConstraintLocator *locator)
410
412
: RequirementFailure(solution, lhs, rhs, locator) {
413
+ #ifndef NDEBUG
411
414
auto reqElt = locator->castLastElementTo <LocatorPathElt::AnyRequirement>();
412
415
assert (reqElt.getRequirementKind () == RequirementKind::SameType);
416
+ #endif
413
417
}
414
418
415
419
protected:
@@ -444,8 +448,10 @@ class SuperclassRequirementFailure final : public RequirementFailure {
444
448
SuperclassRequirementFailure (const Solution &solution, Type lhs, Type rhs,
445
449
ConstraintLocator *locator)
446
450
: RequirementFailure(solution, lhs, rhs, locator) {
451
+ #ifndef NDEBUG
447
452
auto reqElt = locator->castLastElementTo <LocatorPathElt::AnyRequirement>();
448
453
assert (reqElt.getRequirementKind () == RequirementKind::Superclass);
454
+ #endif
449
455
}
450
456
451
457
protected:
@@ -869,9 +875,11 @@ class ThrowingFunctionConversionFailure final : public ContextualFailure {
869
875
ThrowingFunctionConversionFailure (const Solution &solution, Type fromType,
870
876
Type toType, ConstraintLocator *locator)
871
877
: ContextualFailure(solution, fromType, toType, locator) {
878
+ #ifndef NDEBUG
872
879
auto fnType1 = fromType->castTo <FunctionType>();
873
880
auto fnType2 = toType->castTo <FunctionType>();
874
881
assert (fnType1->isThrowing () != fnType2->isThrowing ());
882
+ #endif
875
883
}
876
884
877
885
bool diagnoseAsError () override ;
@@ -890,9 +898,11 @@ class AsyncFunctionConversionFailure final : public ContextualFailure {
890
898
AsyncFunctionConversionFailure (const Solution &solution, Type fromType,
891
899
Type toType, ConstraintLocator *locator)
892
900
: ContextualFailure(solution, fromType, toType, locator) {
901
+ #ifndef NDEBUG
893
902
auto fnType1 = fromType->castTo <FunctionType>();
894
903
auto fnType2 = toType->castTo <FunctionType>();
895
904
assert (fnType1->isAsync () != fnType2->isAsync ());
905
+ #endif
896
906
}
897
907
898
908
bool diagnoseAsError () override ;
0 commit comments