Environment
Ubuntu 16.04 LTS
Swift 3.1.1
Additional Detail from JIRA
| | |
|------------------|-----------------|
|Votes | 0 |
|Component/s | Foundation |
|Labels | Bug, Linux |
|Assignee | None |
|Priority | Medium |
md5: 96839e079b4e6a5a20372cc44f80fb2f
Issue Description:
Summary:
When taking a slice from an instance of Foundation.Data and the left side range is not 0, the slice is off by 1 on Ubuntu 16.04 LTS
Steps to Reproduce:
Download and install swift 3.1.1 per swift.org instructions
In a command prompt:
mkdir DataTest
cd DataTest
swift package init --type executable
vi Sources/main.swift
main.swift code--------------------------------
import Foundation
var test = Data([81, 0, 0, 0, 14])
var test2 = test[1...4]
test2.map({ print($0) })
Environment
Ubuntu 16.04 LTS Swift 3.1.1Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Foundation | |Labels | Bug, Linux | |Assignee | None | |Priority | Medium | md5: 96839e079b4e6a5a20372cc44f80fb2fIssue Description:
Summary:
When taking a slice from an instance of Foundation.Data and the left side range is not 0, the slice is off by 1 on Ubuntu 16.04 LTS
Steps to Reproduce:
Download and install swift 3.1.1 per swift.org instructions
In a command prompt:
mkdir DataTest
cd DataTest
swift package init --type executable
vi Sources/main.swift
main.swift code--------------------------------
import Foundation
var test = Data([81, 0, 0, 0, 14])
var test2 = test[1...4]
test2.map({ print($0) })
:wq out of vi
swift build
.build/debug/DataTest
Expected Results:
expected console output
0
0
0
14
Actual Results:
actual console output
0
0
14
127