mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
24 lines
278 B
Swift
24 lines
278 B
Swift
|
|
class MyClass {
|
|
}
|
|
|
|
func neverCalled() {
|
|
genericCaller(createNil)
|
|
}
|
|
|
|
func createNil() -> MyClass? {
|
|
return nil
|
|
}
|
|
|
|
@inline(never)
|
|
func genericCaller<B>(_ f: () -> B) -> B {
|
|
return f()
|
|
}
|
|
|
|
if createSome() != nil {
|
|
print("test ok")
|
|
} else {
|
|
print("test failed")
|
|
}
|
|
|