The issue you found seems to be specific to MainActor. If I change it to a custom global actor, the code doesn't compile (as expected).
enum Something {
@MyActor static var value = 0
}
let closure: () -> Void = {
Something.value += 1
}
let sendableClosure: @Sendable () -> Void = {
Something.value += 1
closure()
}
I suspect what happened in your code is that:
Since closure captures a variable in MainActor, compiler infers that its signature is @MainActor () -> Void (though it's odd that this doesn't work for custom global actor. See above code).
But later when compiler compiles sendableClosure(). It somehow uses () -> Void, instead of the inferred one @MainActor () -> Void for closure().
I'd suggest you to file a bug to avoid the issue gets silently ignored.