You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1).
Additional Detail from JIRA
Votes
0
Component/s
Foundation
Labels
Bug
Assignee
None
Priority
Medium
md5: 76c67376170b897729726db28c69f686
Issue Description:
In IndexSet.swift, and on the developer.apple.com doc page, it says:
/// The range of valid integer values is 0..<INT_MAX-1. Anything outside this range is an error.
But INT_MAX is-an Int32, so this is only 2**31-1.
In IndexSet.swift, all the comments say INT_MAX (32-bit, always?), but all the code uses Int.max (64-bit, on 64-bit architectures).
IndexSet's public interface uses Int, and it's used in other interfaces (like NSTableView) which use it to index into Int-indexed data structures.
IndexSet is bridged to NSIndexSet, whose documentation says its range is 0...(NSNotFound-1) (where NSNotFound is defined as NSIntegerMax-1, a 64-bit value on 64-bit architectures).
So I think all the documentation/comments about the range of IndexSet are mistaken. It should be 0..<Int.max-1, not 0..<INT_MAX-1, correct?
The text was updated successfully, but these errors were encountered:
Environment
Welcome to Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1).
Additional Detail from JIRA
md5: 76c67376170b897729726db28c69f686
Issue Description:
In IndexSet.swift, and on the developer.apple.com doc page, it says:
/// The range of valid integer values is 0..<INT_MAX-1. Anything outside this range is an error.
But INT_MAX is-an Int32, so this is only 2**31-1.
In IndexSet.swift, all the comments say
INT_MAX
(32-bit, always?), but all the code usesInt.max
(64-bit, on 64-bit architectures).IndexSet's public interface uses Int, and it's used in other interfaces (like NSTableView) which use it to index into
Int
-indexed data structures.IndexSet is bridged to NSIndexSet, whose documentation says its range is 0...(NSNotFound-1) (where NSNotFound is defined as NSIntegerMax-1, a 64-bit value on 64-bit architectures).
So I think all the documentation/comments about the range of IndexSet are mistaken. It should be
0..<Int.max-1
, not0..<INT_MAX-1
, correct?The text was updated successfully, but these errors were encountered: