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-2101] Generics compiler crash regression #44709

Closed
tkrajacic opened this issue Jul 17, 2016 · 8 comments
Closed

[SR-2101] Generics compiler crash regression #44709

tkrajacic opened this issue Jul 17, 2016 · 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 3.0

Comments

@tkrajacic
Copy link

Previous ID SR-2101
Radar rdar://problem/27777612
Original Reporter @tkrajacic
Type Bug
Status Closed
Resolution Done

Attachment: Download

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

md5: f25fe39ae6ac506884282dcc8e00e892

relates to:

  • SR-1939 Swift 3 crashes conforming class to protocol with generic type constraints

Issue Description:

Attached is a minimal example of a compiler crash with generics.
You can open the project in Xcode 7 and 8 and will find that the crash only happens with Swift 3.
Compiling and running works fine in Swift 2.2.

The example is very stripped down so it won't make much sense but I have marked the two lines that - when commented out - make the compiler happy/sad.

When either commenting out the type restraint (marked with comment) or commenting out the `generic dataSource property` the compiler will be happy.

Since this is a regression in Swift 3 I sincerely hope it will be fixed before Swift 3 is released (or someone can present me with a workaround)

@tkrajacic
Copy link
Author

Just FYI this still crashes with the latest Xcode beta 8b3.

@belkadan
Copy link
Contributor

Possibly the same as SR-1939?

@tkrajacic
Copy link
Author

This still crashes with Xcode 8 GM released today.

@bob-wilson
Copy link

This does not appear to be the same as SR-1939. That one is fixed now but this still crashes with a recent build from swift-3.0-branch.

@aschwaighofer
Copy link
Member

A ToT build successfully compiles this:
Arnolds-iMac:dev aschwaighofer$ xcrun $PWD/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swiftc GenericsCrasher.swift
GenericsCrasher.swift:15:5: warning: 'where' clause next to generic parameters is deprecated and will be removed in the future version of Swift
where
~~~^~~~
GenericsCrasher.swift:26:5: warning: 'where' clause next to generic parameters is deprecated and will be removed in the future version of Swift
where
~~~^~~~
Arnolds-iMac:dev aschwaighofer$ xcrun $PWD/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swiftc -v
Swift version 3.0-dev (LLVM a3b3591469, Clang 2d7f563546, Swift 88741f9)
Target: x86_64-apple-macosx10.9

Also fixed on swift-3.0-branch:

Arnolds-iMac:dev aschwaighofer$ xcrun $PWD/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swiftc GenericsCrasher.swift
GenericsCrasher.swift:15:5: warning: 'where' clause next to generic parameters is deprecated and will be removed in the future version of Swift
where
~~~^~~~
GenericsCrasher.swift:26:5: warning: 'where' clause next to generic parameters is deprecated and will be removed in the future version of Swift
where
~~~^~~~
Arnolds-iMac:dev aschwaighofer$ xcrun $PWD/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/bin/swiftc -v
Swift version 3.0.1-dev (LLVM 0e49d60410, Clang 968470f170, Swift a0b6cdd)
Target: x86_64-apple-macosx10.9
Arnolds-iMac:dev aschwaighofer$ cd swift
Arnolds-iMac:swift aschwaighofer$ git lg -1 upstream/swift-3.0-branch

@tkrajacic
Copy link
Author

I can confirm that using the latest snapshot 2016-09-27-a and Xcode 8 (8A218a) this code compiles now.

@aschwaighofer
Copy link
Member

Closing.

@tkrajacic
Copy link
Author

aschwaighofer@apple.com (JIRA User) SR-2796 might be very similar and is not fixed in the latest snapshot. Could you have a look please? Thank you so much!

@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 3.0
Projects
None yet
Development

No branches or pull requests

5 participants