Files
swift-mirror/validation-test/Sema/SwiftUI/rdar94462333.swift
2023-09-21 19:44:03 -07:00

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")
}
}
}
}