Range Type missing startIndex

var text: String = "abc"
let range = text.rangeOfString("b")
println(range!.startIndex) // No member "startIndex" on type "NSRange"

Same here as for Strings :wink:

Although in this case, startIndex & co were already there, just missing the “public” flag. Fixed.

Still failing in 1665

Hmm, weird

public class Range {
    ...	
    public var startIndex: IntMax 
    public var endIndex: IntMax

i’ll double-check and make sure the latest version went into the build. This is on Cocoa, i assume?

—marc

Oh, wait. NSString.rangeOfString returns a NSRange, not a Swift range! Right now, String just maps to each platforms native String type — NSString on Cocoa. Not to a Swift-specific String type. We’ll need to review how this is handled.