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-11018] Compiler Crasher with cross file + multiple protocols with associated types + protocol extensions. #53408

Closed
swift-ci opened this issue Jun 26, 2019 · 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

Previous ID SR-11018
Radar rdar://problem/52194213
Original Reporter pschuh (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, CompilerCrash
Assignee @slavapestov
Priority Medium

md5: f4b22e2ebb4264ec9cbf56a249fd2d3f

relates to:

  • TF-603 fast.ai notebook: 05_anneal doesn't compile

Issue Description:

The minimal reproducer is:

// file1.swift
public protocol Proto1 {
    associatedtype Input
    func func1(_ input: Input) -> Input
}
public protocol Proto2: Proto1 {
    associatedtype Input
    func func2(_ input: Input) -> Input
}
public extension Proto2 {
    func func1(_ input: Input) -> Input { return func2(input) }
}
public struct Struct: Proto2 {
    public func func2(_ input: Float) -> Float { return input }
}
// file2.swift
func reproducer() -> Float { return Struct().func1(1.0) }

Then run:

$ swiftc file1.swift file2.swift
...
swift: /swift-source/swift/lib/AST/ProtocolConformance.cpp:913: swift::ProtocolConformanceRef swift::NormalProtocolConformance::getAssociatedConformance(swift::Type, swift::ProtocolDecl *, swift::LazyResolver *) const: Assertion `!getSignatureConformances().empty() && "signature conformances not yet computed"' failed.
Stack dump:
...
RangeText="Struct().func1(1.0"
@belkadan
Copy link
Contributor

Thank you for the nice, simple reproducer!

@swift-ci
Copy link
Collaborator Author

Comment by Parker Schuh (JIRA)

It appears to be a regression caused by: #25044 I found this by bisecting the master branch.

@belkadan
Copy link
Contributor

cc @slavapestov

@slavapestov
Copy link
Member

This was fixed by #25986 I’m adding a regression test in #25987

@swift-ci
Copy link
Collaborator Author

swift-ci commented Jul 8, 2019

Comment by Parker Schuh (JIRA)

Solved by deleting more code than you added; Nice!

@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

4 participants