Skip to content

Fixed addObserver's obsolescence #1429

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

Closed
wants to merge 1 commit into from

Conversation

felix91gr
Copy link
Contributor

As per this post in the forums.

Fixed with Xiaodi's suggestion.
It passed ninja test in my computer and it fixed the problem I described after I rebuilt my binaries with this patch.

I think we need to run a ninja test in CI, just to be sure. After that, it should be ready for merge.

As per [this post](https://forums.swift.org/t/found-a-bug-in-foundations-obsolescence-mechanism-in-linux/7730) in the forums.

Fixed with Xiaodi's suggestion.
It passed `ninja test` in my computer and it fixed the problem I described after I rebuilt my binaries with this patch.

I think we need to run a `ninja test` in CI, just to be sure. After that, it should be ready for merge.
@spevans
Copy link
Contributor

spevans commented Feb 10, 2018

@swift-ci please test

@ikesyo
Copy link
Member

ikesyo commented Feb 10, 2018

This would revert the changes in #1323. Please reconsider this. I think @available(swift, should be used here instead of @available(*,.

@ikesyo
Copy link
Member

ikesyo commented Feb 10, 2018

@ikesyo
Copy link
Member

ikesyo commented Feb 10, 2018

@felix91gr
Copy link
Contributor Author

Oh. There was already context for this! Nice.

Let’s see... hmm. Did #1323 solve SR-6419?

The problem this tries to fix is that the function is still ambiguous, at least in Linux (which is my setup).

Quoting Xiaodi,

An immediate source-compatible fix would be to disable trailing closure syntax selectively for the obsolete function by tacking on a defaulted Void parameter. That way, any explicit use of the obsolete function still works and prompts the warning, and any use of trailing closure syntax becomes unambiguous.

If I understood them correctly, it should suffice to keep #1323’s obsolescence but change the function’s signature. Is that correct?

@ikesyo
Copy link
Member

ikesyo commented Feb 10, 2018

The problem this tries to fix is that the function is still ambiguous, at least in Linux (which is my setup).

The issue is in Swift 4.0.2 and 4.0.3 on Linux (and not in 4.0). #1323 is included in recent 4.1-DEVELOPMENT-SNAPSHOT builds. Did you try building your code with the snapshots?

@felix91gr
Copy link
Contributor Author

Did you try building your code with the snapshots?

I tried, but I did it wrong. I can try it again, now that I’ve remembered how to change my toolchains.

Gimme a day.

(I’m going to be without internet starting from tomorrow, so if I don’t come back soon-ish, you can expect me to appear again around the 17th)

@felix91gr
Copy link
Contributor Author

You were right all along. I tested the 4.1 snapshots and the bug was long gone! Thank you :)

@felix91gr felix91gr closed this Feb 10, 2018
@felix91gr felix91gr deleted the patch-1 branch February 10, 2018 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants