mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
21 lines
396 B
Swift
21 lines
396 B
Swift
// RUN: %target-run-simple-swift(-enable-experimental-feature RawLayout) | %FileCheck %s
|
|
// REQUIRES: executable_test
|
|
|
|
@_rawLayout(like: T)
|
|
struct Cell<T>: ~Copyable {}
|
|
|
|
struct Foo<T>: ~Copyable {
|
|
let cell = Cell<T>()
|
|
let myValue = 123
|
|
}
|
|
|
|
func something<T>(_ x: borrowing Foo<T>) -> Int {
|
|
x.myValue
|
|
}
|
|
|
|
// CHECK: 123
|
|
print(something(Foo<Bool>()))
|
|
|
|
// CHECK: 123
|
|
print(something(Foo<Int>()))
|