Files
swift-mirror/test/Inputs/forward_extension_reference.swift
Joe Pamer 31bab38eb4 When attempting to obtain the context type of a type extension, we were never taking into account the fact that the extended type could be potentially be unbound.
(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
2014-04-02 16:48:14 +00:00

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)
}
}
}