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-12411] Swift 5.2 Linux Formatter lacks objectValue #4394

Open
swift-ci opened this issue Mar 25, 2020 · 4 comments
Open

[SR-12411] Swift 5.2 Linux Formatter lacks objectValue #4394

swift-ci opened this issue Mar 25, 2020 · 4 comments

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-12411
Radar rdar://problem/62200963
Original Reporter helge (JIRA User)
Type Bug
Environment

Linux Swift 5.2

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

md5: af98a313f72a48ac3f902a8aceaa69be

Issue Description:

SwiftObjects started to fail to build w/ 5.2 because `objectValue(_ s: String)` was made unavailable:

    @available(*, unavailable, message: "Use each formatter's class and instance methods instead.")
    open func objectValue(_ string: String) throws -> Any? {
        NSUnsupported()
    }

You still provide a generic `string(for🙂`, why did you drop the reverse? It's the sole purpose of the base class to provide those abstract methods to allow the user to interchange the implementations.

Used in here: https://github.com/SwiftObjects/SwiftObjects/blob/master/Sources/SwiftObjects/Elements/Formatters/WOFormatter.swift#L83

@spevans
Copy link
Collaborator

spevans commented Mar 25, 2020

objectValue(_ s: String) has been unavailable since before 5.2, I think the issue is that DateComponentsFormatter and PersonNameComponentsFormatter were marked unavailable in 5.2

@swift-ci
Copy link
Contributor Author

Comment by Helge Heß (JIRA)

According to my code the regular Cocoa `getObjectValue` was unavailable, but `objectValue`was available. This only started to break w/ 5.2 as far as I can tell.

You can easily see this over here, builds fine on 5.0 (no complaint about objectValue), vs 5.2: https://travis-ci.org/github/SwiftObjects/SwiftObjects/builds/666572009?utm_medium=notification&utm_source=slack

@swift-ci
Copy link
Contributor Author

Comment by Helge Heß (JIRA)

And FWIW I'd prefer if the regular `getObjectValue` would be available. Using specific classes renders the base class useless and is inconsistent with the string-for Any variant, which is available and doesn't require using hardcoded implementations.

@beccadax
Copy link
Contributor

@swift-ci create

@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
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