mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
These are tests that fail in the next commit without this flag. This does not add -verify-ignore-unrelated to all tests with -verify, only the ones that would fail without it. This is NFC since this flag is currently a no-op.
30 lines
654 B
Swift
30 lines
654 B
Swift
// RUN: %target-typecheck-verify-swift -verify-ignore-unrelated -target %target-cpu-apple-macosx10.15 -swift-version 5
|
|
|
|
// REQUIRES: objc_interop
|
|
// REQUIRES: OS=macosx
|
|
|
|
import SwiftUI
|
|
|
|
struct Item {
|
|
let id = UUID()
|
|
let text = ""
|
|
}
|
|
|
|
class ItemList: ObservableObject {
|
|
@Published var items = [Item]()
|
|
}
|
|
|
|
@available(SwiftStdlib 5.3, *)
|
|
struct ContentView: View {
|
|
@StateObject var list = ItemList()
|
|
|
|
var body: some View {
|
|
List {
|
|
ForEach(list.items) { item in
|
|
// expected-error@-1 {{referencing initializer 'init(_:content:)' on 'ForEach' requires that 'Item' conform to 'Identifiable'}}
|
|
Text(item.text)
|
|
}
|
|
}
|
|
}
|
|
}
|