Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Foundation/NSArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,11 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS

public subscript (idx: Int) -> AnyObject {
get {
// TODO: Bounds checking
return objectAtIndex(idx)
    guard idx < count && idx >= 0 else {
        fatalError("\(self): Index out of bounds")
    }

    return objectAtIndex(idx)
}
}

Expand Down