mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
29 lines
527 B
Swift
29 lines
527 B
Swift
// RUN: %target-typecheck-verify-swift -target %target-cpu-apple-macosx10.15 -swift-version 5
|
|
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: OS=macosx
|
|
|
|
import SwiftUI
|
|
|
|
@MainActor func someMainActorFn() {}
|
|
|
|
struct ContentView: View {
|
|
var body: some View {
|
|
VStack {
|
|
Button(action: someMainActorFn) {
|
|
Text("Sign In")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ContentViewExplicitAnnotation: View {
|
|
var body: some View {
|
|
VStack { @MainActor in
|
|
Button(action: someMainActorFn) {
|
|
Text("Sign In")
|
|
}
|
|
}
|
|
}
|
|
}
|