示例工程 40-windows-scenes-macos

40-windows-scenes-macos/Diagnostics/WindowWithoutID.swift

swift · 0.3 KB

// 故意编译失败:Window 场景必须显式提供 id,才能被 openWindow 定位。
// 复现:swiftc -typecheck Diagnostics/WindowWithoutID.swift
import SwiftUI
 
struct A: App {
    var body: some Scene {
        Window("统计") {
            Text("x")
        }
    }
}