// 故意编译失败:尺寸类是枚举,不能直接赋字符串。 // 复现:swiftc -typecheck Diagnostics/SizeClassString.swift import SwiftUI let size: UserInterfaceSizeClass = "compact"