mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[move-only] Suppress moveonly errors when an inout is captured by an escaping closure since we will already emit a more specific capture error.
This commit is contained in:
@@ -410,6 +410,11 @@ void SILGenFunction::emitCaptures(SILLocation loc,
|
||||
} else {
|
||||
// If we have a mutable binding for a 'let', such as 'self' in an
|
||||
// 'init' method, load it.
|
||||
if (Val->getType().isMoveOnly()) {
|
||||
Val = B.createMarkMustCheckInst(
|
||||
loc, Val,
|
||||
MarkMustCheckInst::CheckKind::AssignableButNotConsumable);
|
||||
}
|
||||
Val = emitLoad(loc, Val, tl, SGFContext(), IsNotTake).forward(*this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user