Skip to content

Commit 48e19dc

Browse files
committed
[NFC] TypeLowering: Strengthen assertion.
Now that verification bails out on the top level in the face of types with type parameters, there's no need to bail out when visiting leaves.
1 parent 1da24ec commit 48e19dc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3142,16 +3142,13 @@ void TypeConverter::verifyTrivialLowering(const TypeLowering &lowering,
31423142
/*visit=*/
31433143
[&](auto ty, auto origTy, auto *field, auto index) -> bool {
31443144
// Return false to indicate visiting a type parameter.
3145-
3146-
if (origTy.isTypeParameter())
3147-
return false;
3148-
3149-
// Unfortunately, the type parameter's conformance may not be visible
3150-
// here.
31513145
assert(M.checkConformance(ty, bitwiseCopyableProtocol) &&
31523146
"leaf of non-trivial BitwiseCopyable type that doesn't "
31533147
"conform to BitwiseCopyable!?");
31543148

3149+
if (origTy.isTypeParameter())
3150+
return false;
3151+
31553152
return true;
31563153
});
31573154
if (hasNoConformingArchetypeNode) {

0 commit comments

Comments
 (0)