示例工程 27-combine-to-async

27-combine-to-async/Diagnostics/PublishedInStruct.swift

swift · 0.2 KB

// 故意编译失败:@Published 只能用于类属性。
// 复现:swiftc -typecheck Diagnostics/PublishedInStruct.swift
import Combine
 
struct Model {
    @Published var query = ""
}