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-6394] fatal error: X is not yet implemented: file Foundation/~~~, line ## #4056

Closed
swift-ci opened this issue Nov 15, 2017 · 9 comments
Closed

Comments

@swift-ci
Copy link
Contributor

Previous ID SR-6394
Radar rdar://35562622
Original Reporter p_thompson (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

Linux w/ Swift 4

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

md5: ca18b9d655db6313731c5a10e8514cce

duplicates:

  • SR-10347 Parity: Remove all uses of NSUnimplemented from swift-corelibs-foundation

Issue Description:

It would be really nice if these issues threw a compiler warning rather than a runtime error. I'm trying to deploy a heroku app that works fine on Mac, and builds fine on linux with no warnings, but crashes at runtime. The experience would be much nicer if I didn't have to build, run, and discover each missing part of Foundation on Server.

@swift-ci
Copy link
Contributor Author

Comment by Sergo Beruashvili (JIRA)

@belkadan @phausler What do you think about marking all the NSUnimplemented functions with @available(*, unavailable, message: "Not available on non-Darwin platforms")

@spevans
Copy link
Collaborator

spevans commented Nov 30, 2018

@parkera @millenomi, would you accept a PR that adds an available annotation to all of the currently NSUnimplemented functions? I think the upside of compile-time errors would outway the downside of the code-spam, and having spoken to other Swift on Linux developers it is a source of annoyance to have the runtime crash instead.

@millenomi
Copy link
Contributor

@spevans only after we remove as many as possible before the end of 5.0.

@parkera
Copy link
Member

parkera commented Nov 30, 2018

Is that primarily to avoid wasted effort? It's something we're planning on doing regardless.

@parkera
Copy link
Member

parkera commented Nov 30, 2018

One thing about this - we have to be careful about it being an availability thing in scenarios like this, totally contrived, example:

public func a(_ v: Int) {
{{ if v % 2 == 0 { b() }}}{{ }}

{{ else { c() }}}

{{}}}

internal func b() { /* available */ }

internal func c() { /* unimplemented */ }

@parkera
Copy link
Member

parkera commented Nov 30, 2018

Bleh. I give up on JIRA's formatting. But you get the idea. 🙂

@spevans
Copy link
Collaborator

spevans commented Dec 1, 2018

I'd only apply it to the public function declarations and try to avoid any that I think will be implemented for 5.0 or are in the PR queue.

@parkera
Copy link
Member

parkera commented Dec 1, 2018

Ok, so basically top-level stuff only?

The thing I wanted to avoid was some kind of "viral unavailability", where one lower level function being unavailable causes a bunch of higher level stuff that may call it only in specific scenarios to become unavailable always.

I guess discovering if there are any key functions in that path would be a useful side effect.

@millenomi
Copy link
Contributor

We've done this as part of https://bugs.swift.org/browse/SR-10347.

@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

4 participants