Skip to content

Commit 8232270

Browse files
committed
[TypeLowering] Correct assertion.
When examining non-trivial types which were non-lexical, when a field lacks a field decl (as happens with tuples), whether the type was annotated @_eagerMove was overlooked, resulting in incorrectly determining that a leaf was lexical.
1 parent bdb58a3 commit 8232270

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,10 +2500,9 @@ void TypeConverter::verifyLowering(const TypeLowering &lowering,
25002500
// Otherwise, the whole type would be lexical.
25012501

25022502
if (!fieldDecl) {
2503-
// The field is non-trivial and the whole type is non-lexical.
2504-
// If there's no field decl which might be annotated
2505-
// @_eagerMove, we have a problem.
2506-
return false;
2503+
// There is no field decl that might be annotated @_eagerMove. The
2504+
// field is @_eagerMove iff its type is annotated @_eagerMove.
2505+
return getLifetimeAnnotation(ty) == LifetimeAnnotation::EagerMove;
25072506
}
25082507

25092508
// The field is non-trivial and the whole type is non-lexical.

0 commit comments

Comments
 (0)