mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
(This could occur, for instance, via a forward reference to a member defined in an extension to a generic type.) This problem has been popping up a lot lately, and was making some of the recent runtime work difficult. (rdar://problem/16481483) Swift SVN r15805
18 lines
356 B
Swift
18 lines
356 B
Swift
extension Foo : Bar {
|
|
var count: Int {
|
|
get {
|
|
var x = Int(_countAndFlags >> 1)
|
|
var y = Int(_countAndFlags >> 1)
|
|
var z = _countAndFlags >> 1
|
|
return x
|
|
}
|
|
set {
|
|
let growth = newValue - count
|
|
if growth == 0 {
|
|
return
|
|
}
|
|
_countAndFlags = (UInt(newValue) << 1) | (_countAndFlags & 1)
|
|
}
|
|
}
|
|
}
|