Here is a straightforward use of a static member inside an instance method:
public struct RankSet {
private let rankSet : UInt8
static let counts : [UInt
The error message is misleading: static members can be accessed from any piece of code that has proper visibility to them, which includes instance methods.
However, Swift does not provide a short name access to static members from instance methods - a common feature of many other programming languages. This is what is causing the error above.
Swift insists on fully qualifying names of static members, as follows:
public var count : Int {
get {
return Int(RankSet.counts[Int(rankSet)])
// ^^^^^^^^
}
}