I noticed that is new in Swift 5.9 from Xcode 15 beta 7. import Cocoa is no longer enough to import AppKit. I think this is for the first time in the history of the Cocoa module.
import Cocoa
open class Foo: NSView { // Cannot use class 'NSView' here; 'AppKit' was not imported by this file
}
worth noting that the Cocoa module itself is an umbrella for:
import AppKit
import CoreData
import Foundation
since I woke up to 169 warnings on a small project, I dare to ask if this is a feature or a bug?
Doesn't look expected to me, and I wasn't able to reproduce it with a sample project containing just the example you provided. Does it reproduce trivially for you in a brand new project? I wonder if there's additional context required.