// REQUIRES: concurrency
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/Modules)
// RUN: split-file %s %t
// RUN: %target-swift-frontend -emit-module -o %t/Modules/MyModule.swiftmodule -module-name MyModule %t/MyModule.swift -target %target-swift-5.1-abi-triple
// RUN: %sourcekitd-test -req=cursor -pos=1:15 %t/MyModule.swift -- %t/MyModule.swift -target %target-triple | %FileCheck -check-prefix=ACTOR %s
// RUN: %sourcekitd-test -req=cursor -pos=2:15 %t/MyModule.swift -- %t/MyModule.swift -target %target-triple | %FileCheck -check-prefix=FUNC %s
// RUN: %sourcekitd-test -req=cursor -pos=5:16 %t/MyModule.swift -- %t/MyModule.swift -target %target-triple | %FileCheck -check-prefix=ACTOR %s
// RUN: %sourcekitd-test -req=cursor -pos=6:19 %t/MyModule.swift -- %t/MyModule.swift -target %target-triple | %FileCheck -check-prefix=FUNC %s
// ACTOR: public actor MyActor
// ACTOR: public actor MyActor
// FUNC: public func asyncFunc(fn: () async -> Void) async throws
// FUNC: public func asyncFunc(fn: () async -> Void) async throws
// RUN: %sourcekitd-test -req=cursor -pos=3:16 %t/App.swift -- %t/App.swift -target %target-triple -I %t/Modules | %FileCheck -check-prefix=ACTOR_XMOD %s
// RUN: %sourcekitd-test -req=cursor -pos=4:19 %t/App.swift -- %t/App.swift -target %target-triple -I %t/Modules | %FileCheck -check-prefix=FUNC_XMOD %s
// ACTOR_XMOD: actor MyActor
// ACTOR_XMOD: actor MyActor
// FUNC_XMOD: func asyncFunc(fn: () async -> Void) async throws
// FUNC_XMOD: func asyncFunc(fn: () async -> Void) async throws
//--- MyModule.swift
public actor MyActor {
public func asyncFunc(fn: () async -> Void) async throws {}
}
func test(act: MyActor) async throws {
try await act.asyncFunc {}
}
//--- App.swift
import MyModule
func test(act: MyActor) async throws {
try await act.asyncFunc {}
}