mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
25 lines
420 B
Swift
25 lines
420 B
Swift
// RUN: %target-swift-frontend -emit-silgen -verify %s
|
|
|
|
// SR-3090:
|
|
|
|
class Box<T> {
|
|
public let value: T
|
|
|
|
public init(_ value: T) {
|
|
self.value = value
|
|
}
|
|
}
|
|
|
|
let box = Box((22, { () in }))
|
|
let foo = box.value.0
|
|
print(foo)
|
|
|
|
// Another crash -- re-abstracting function type inside optional in tuple
|
|
// in-place
|
|
|
|
func g<T>() -> (Int, T)? { }
|
|
|
|
func f<T>(t: T) {
|
|
let _: (Int, ((T) -> (), T))? = g()
|
|
}
|