Hey all,
I'm trying to use swftc to typecheck very simple snippets of code, but I'm having an issue with @NSApplicationMain.
import AppKit
@NSApplicationMain
class ClassA: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {}
}
swiftc -sdk $(xcrun --show-sdk-path --sdk macosx) -typecheck test.swift
test.swift:3:1: error: 'NSApplicationMain' attribute cannot be used in a module that contains top-level code
@NSApplicationMain
^
test.swift:1:1: note: top-level code defined in this source file
import AppKit
^
Naming the file main.swift has no affect, and I don't see any compiler options that relate to entry points? What's the magic ingredient I'm missing here?