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-8985] Swift 4.2 Conditional Conformance Linux Regression #51489

Closed
stephencelis opened this issue Oct 12, 2018 · 8 comments
Closed

[SR-8985] Swift 4.2 Conditional Conformance Linux Regression #51489

stephencelis opened this issue Oct 12, 2018 · 8 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 4.2

Comments

@stephencelis
Copy link
Contributor

Previous ID SR-8985
Radar rdar://problem/45576015
Original Reporter @stephencelis
Type Bug
Status Resolved
Resolution Cannot Reproduce
Environment

Swift 4.2 from https://hub.docker.com/r/norionomura/swift/

So tag "siwft-4.2-RELEASE", Ubuntu 16.04

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 4.2Regression, CompilerCrash
Assignee None
Priority Medium

md5: 7e106198346b215a7bda8b4ea4154b89

Issue Description:

We noticed that a library of ours that heavily relies on conditional conformance broke on Linux with the release of Swift 4.2.

The issue is reproducible from the first commit of this PR:

pointfreeco/swift-nonempty#8

Merely check out the repository and, with Docker running, run "make test-linux".

@stephencelis
Copy link
Contributor Author

@stephencelis
Copy link
Contributor Author

Interestingly enough, even if I try to #if os(Linux) the issue, an AST check blows things up:

pointfreeco/swift-nonempty@cfa55ac

I can't even retain conditional conformance on non-Linux platforms 🙁

@belkadan
Copy link
Contributor

@swift-ci create

@belkadan
Copy link
Contributor

I'll try to reproduce this pretty soon, but meanwhile is it possible to check with a master snapshot? We changed a lot of things about how generic parameters are implemented that couldn't be cherry-picked to 4.2, so it's possible this is "already" fixed. (Even though it won't be out for a while, sorry.)

@belkadan
Copy link
Contributor

Okay, a master snapshot does this:

/home/jrose/swift-nonempty/Sources/NonEmpty/NonEmpty+Dictionary.swift:109:12: error: generic parameter 'Key' could not be inferred
    return Dictionary(uniqueKeysWithValues: Array(lhs))
           ^
Swift.Dictionary:1:15: note: 'Key' declared as parameter to type 'Dictionary'
public struct Dictionary<Key, Value> where Key : Hashable {
              ^
/home/jrose/swift-nonempty/Sources/NonEmpty/NonEmpty+Dictionary.swift:109:12: note: explicitly specify the generic arguments to fix this issue
    return Dictionary(uniqueKeysWithValues: Array(lhs))
           ^
                     <<#Key: Hashable#>, Any>

@belkadan
Copy link
Contributor

…which is SR-9068. So I'm not sure if this is fixed yet or not.

@belkadan
Copy link
Contributor

Okay, replacing that body with return true made everything compile. So I'll try to get this down to a reproducible test case and add it to the suite, but it looks like it's fixed on master.

@belkadan
Copy link
Contributor

I never managed to add the test case and I can't even get this to fail anymore (Swift 4.2 on Ubuntu 18.04). At this point I think it's not worth spending time on anymore.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself crash Bug: A crash, i.e., an abnormal termination of software regression swift 4.2
Projects
None yet
Development

No branches or pull requests

3 participants