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-4489] Cannot compile Sift 3.0.2 code with Swift 3.1. #47066

Closed
swift-ci opened this issue Apr 4, 2017 · 5 comments
Closed

[SR-4489] Cannot compile Sift 3.0.2 code with Swift 3.1. #47066

swift-ci opened this issue Apr 4, 2017 · 5 comments
Assignees
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

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Apr 4, 2017

Previous ID SR-4489
Radar None
Original Reporter Vespen (JIRA User)
Type Bug
Status Resolved
Resolution Cannot Reproduce
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 3.1Regression, CompilerCrash
Assignee @slavapestov
Priority Medium

md5: fe5f42589382a0d3aa36ae07730f6367

Issue Description:

Following code successfully compiles with Swift 3.0.2 compiler but not with Swift 3.1. It looks totally legit but causes compiler segmentation fault. If you uncomment constructor, you will see totally unexpected error message (type U is not Hashable).

import Foundation

protocol GenericProtocol: class {
    associatedtype U: Hashable
    associatedtype V: Hashable
}

class ConcreteProtocol: GenericProtocol {
    typealias U = Int
    typealias V = Int
}

class Base<U: Hashable, V: Hashable> {
}

class Concrete<T, U, V> : Base<U, V>
    where T: GenericProtocol, U: Hashable, V: Hashable, T.U == U, T.V == V {
    
//    override init() {
//        super.init()
//    }
}

let instance = Concrete<ConcreteProtocol, Int, Int>()
@gregomni
Copy link
Collaborator

gregomni commented Apr 4, 2017

Builds fine on head.

@belkadan
Copy link
Contributor

belkadan commented Apr 4, 2017

@slavapestov, here's another "a typealias in a protocol may or may be a same-type requirement".

@belkadan
Copy link
Contributor

belkadan commented Apr 4, 2017

The crash is unfortunate.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Apr 5, 2017

Comment by Anton Lagutin (JIRA)

I am using default compiler that was shipped with Xcode 8.3 (8E162)

Apple Swift version 3.1 (swiftlang-802.0.48 clang-802.0.38)

@slavapestov
Copy link
Member

No longer crashes in Xcode 9.3.

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

No branches or pull requests

5 participants