mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
20 lines
410 B
Swift
20 lines
410 B
Swift
// WORKAROUND: This is a hack to allow us to emulate iVars of generic
|
|
// parameter type. See <rdar://problem/13560747> IRGen explodes on
|
|
// ivar of generic parameter type
|
|
struct GenericIVar<T> {
|
|
constructor() {
|
|
__value = new T[1]
|
|
}
|
|
constructor(x: T) {
|
|
__value = new T[1]
|
|
__value[0] = x
|
|
}
|
|
var value : T {
|
|
get:
|
|
return __value[0]
|
|
set(x):
|
|
__value[0] = x
|
|
}
|
|
var __value: T[]
|
|
}
|