Unexpected error with implementing `init()` in a subclass

The following won't compile in Swift 6 language mode with Xcode 16b5 (swift-driver version: 1.113 Apple Swift version 6.0 (swiftlang-6.0.0.7.6 clang-1600.0.24.1).

My question is why init() is not isolated to MainActor? Is this some kind of regression that will solve itself in a future beta, or should I be looking at a different pattern for subclassing UIKit classes?

import UIKit

class MyView: UIView {
  init() {
    super.init(frame: .zero) // Call to main actor-isolated initializer 'init(frame:)' in a synchronous nonisolated context
  }

  @available(*, unavailable)
  required init?(coder: NSCoder) {
    fatalError("use init()")
  }
}
1 Like

Answering my own question, it is a regression that has already been fixed. Hopefully the fix makes into beta 6.