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-14672] Array conformance crashes on Linux for Swift 5.4 #57023

Closed
grahamburgsma opened this issue May 28, 2021 · 4 comments
Closed

[SR-14672] Array conformance crashes on Linux for Swift 5.4 #57023

grahamburgsma opened this issue May 28, 2021 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@grahamburgsma
Copy link

Previous ID SR-14672
Radar rdar://problem/78626943
Original Reporter @grahamburgsma
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Crashes on: Swift 5.4.1 on Ubuntu 18.04.

Works on: Swift 5.4 on MacOS 11.4

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

md5: b57c4b463b28025b0c8cae6531ec75d7

Issue Description:

This code used to work on Swift 5.3, but no longer compiles on Swift 5.4 or 5.4.1.

On MacOS (11.4) the code compiles successfully. However with Linux (through Docker) it crashes.

Crash log included in output.txt. Reproducible project also attached.

protocol PublicContent {
    associatedtype Model
    init(_ model: Model)
}

protocol PublicConvertible {
    associatedtype Public
    func toPublic() -> Public
}

extension PublicConvertible where Public: PublicContent, Public.Model == Self {
    func toPublic() -> Public {
        Public(self)
    }
}

extension Array: PublicConvertible where Element: PublicConvertible {
    func toPublic() -> [Element.Public] {
        map { $0.toPublic() }
    }
}
@typesanitizer
Copy link

Could you specify which versions you tried on macOS? There is an assertion failure here in the type-checker; typically type-checker bugs like this one don't vary from platform to platform.

@typesanitizer
Copy link

@swift-ci create

@grahamburgsma
Copy link
Author

theindigamer (JIRA User) Added to the environment details. Using Swift 5.4 on macOS 11.4.

@slavapestov
Copy link
Member

#38007

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

3 participants