Skip to content

[SR-12671] URLResponse.init is not accessible in FoundationNetworking #4388

Open
@swift-ci

Description

@swift-ci
Previous ID SR-12671
Radar rdar://problem/62895021
Original Reporter Saklad5 (JIRA User)
Type Bug
Environment

I have confirmed that the initializer exists in the Darwin version of Foundation on macOS 10.15.4, but not in commit b83118f (the master branch at the time of this writing) of the platform-agnostic version.

The initializer is also inaccessible when using Swift 5.2.2 on Ubuntu 18.04.4, which is what prompted this issue in the first place.

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

md5: a2d3e8f034811a8c4f5024156635cbd9

Issue Description:

The Darwin version of Foundation has parameter-less initializers for URLResponse and its subclasses, which are somewhat useful for writing unit tests. These are not present in FoundationNetworking, for reasons that are somewhat unclear.

In other words, the following works with the Darwin version alone:

let mock = URLResponse()

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