Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-12450] NSString is not LosslessStringConvertible on Linux #4391

Closed
swift-ci opened this issue Mar 30, 2020 · 2 comments
Closed

[SR-12450] NSString is not LosslessStringConvertible on Linux #4391

swift-ci opened this issue Mar 30, 2020 · 2 comments
Assignees

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-12450
Radar rdar://problem/62201058
Original Reporter rexmas (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Ubuntu 18.04

Swift 5.2

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

md5: d5d6e088238b0c54331564ba18cc19ea

Issue Description:

NSString is not LosslessStringConvertible on Linux:

$ cat NSTest.swift
import Foundation
let nss = "a" as NSString
print(nss)
print(String(nss))

$ swift NSTest.swift 
NSTest.swift:5:7: error: initializer 'init(_:)' requires that 'NSString' conform to 'LosslessStringConvertible'
print(String(nss))
      ^
Swift.String:4:23: note: where 'T' = 'NSString'
    @inlinable public init<T>(_ value: T) where T : LosslessStringConvertible 

Doing the same test from MacOS prints fine:

$ swift NSTest.swift 
a
a 
@beccadax
Copy link
Contributor

@swift-ci create

@spevans
Copy link
Collaborator

spevans commented Jun 4, 2020

This actually looks to be a missing initialiser, the message

error: initializer 'init(_:)' requires that 'NSString' conform to 'LosslessStringConvertible'

seems to be incorrect.

#2813

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants