Skip to content

[SR-14412] swift-corelibs-foundation’s firstRange(of:in:) and lastRange(of:in:) do not mirror macOS Foundation behavior when searched data is empty #3230

Closed
@Frizlab

Description

@Frizlab
Previous ID SR-14412
Radar None
Original Reporter @Frizlab
Type Bug
Environment

macOS: 11.2.3 (20D91), Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)

Linux: Docker image 2510a162d49e, Swift version 5.3.3 (swift-5.3.3-RELEASE)

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee None
Priority Medium

md5: e510ad147fb65e09109745e2fddd9fdd

Issue Description:

On macOS, with an empty searched data, `nil` is returned; on Linux (swift-5.3.3-RELEASE), an empty Range is returned.

I submitted a PR to mirror macOS’s behavior: #2992

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions