mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
10 lines
356 B
Swift
10 lines
356 B
Swift
// RUN: %target-swift-frontend -emit-silgen %s -module-name test -swift-version 5 | %FileCheck %s
|
|
// REQUIRES: concurrency
|
|
|
|
// Declarations don't mangle global actor types.
|
|
// CHECK: @$s4test10returnsOptyxycSgxyScMYccSglF
|
|
func returnsOpt<R>(_ fn: (@MainActor () -> R)?) -> (() -> R)? {
|
|
typealias Fn = (() -> R)?
|
|
return unsafeBitCast(fn, to: Fn.self)
|
|
}
|