mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Our name lookup rules for the resolution of custom attributes don't allow for them to find MainActor within the _Concurrency library. Therefore, hardcode @MainActor to map to _Concurrency.MainActor. While here, make sure we drop concurrency-specific attributes that show up in Clang attributes when we aren't in concurrency mode.
25 lines
745 B
Swift
25 lines
745 B
Swift
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -I %S/Inputs/custom-modules %s -verify
|
|
|
|
// REQUIRES: objc_interop
|
|
import Foundation
|
|
import ObjCConcurrency
|
|
|
|
func testSlowServerSynchronous(slowServer: SlowServer) {
|
|
// synchronous version
|
|
let _: Int = slowServer.doSomethingConflicted("thinking")
|
|
slowServer.poorlyNamed("hello") { (i: Int) in print(i) }
|
|
slowServer.customize(with: "hello") { (i: Int) in print(i) }
|
|
|
|
slowServer.dance("jig") { s in print(s + "") }
|
|
slowServer.leap(17) { s in print(s + "") }
|
|
slowServer.repeatTrick("jump") { i in print(i + 1) }
|
|
}
|
|
|
|
func testSlowServerOldSchool(slowServer: SlowServer) {
|
|
slowServer.doSomethingSlow("mail") { i in
|
|
_ = i
|
|
}
|
|
|
|
_ = slowServer.allOperations
|
|
}
|