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-7968] Compiler crash when accessing protocol extension method by type name #50503

Closed
swift-ci opened this issue Jun 11, 2018 · 2 comments
Closed
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

Previous ID SR-7968
Radar None
Original Reporter petro.korienev (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

Xcode 9.4 (9F1027a)
Apple Swift version 4.1.2 (swiftlang-902.0.54 clang-902.0.39.2)
Target: x86_64-apple-darwin17.5.0

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

md5: eab294d27a1c3f11c4eaf735faec2b76

duplicates:

  • SR-75 Referencing a protocol function crashes the compiler

Issue Description:

Current version of swift compiler crashes on following minimal code sample
{Code}
protocol A {}

extension A {
func methodA() { print(self) }
}

extension String: A {}

let array = ["One", "Two", "Three"]
.map { $0 as? A }
.compactMap { $0 }
.map(A.methodA)

{Code}

Getting rid of last map (where compiler should infer type of result by the type of closure, obtained via accessing protocol extension method by typename) fixes issue

Attached stack trace crashdump.txt

@belkadan
Copy link
Contributor

I'm pretty sure we have a dup for this, but I don't see it right now. @slavapestov?

@swift-ci
Copy link
Collaborator Author

Comment by Petro Korienev (JIRA)

@belkadan Never mind, found this one https://bugs.swift.org/browse/SR-75
Didn't expect to dig so deep down to 2015

@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

3 participants