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-15742] Unreachable "these types are always canonical" executed #58019

Open
ahoppen opened this issue Jan 17, 2022 · 1 comment
Open

[SR-15742] Unreachable "these types are always canonical" executed #58019

ahoppen opened this issue Jan 17, 2022 · 1 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 found by stress tester Flag: An issue found by the SourceKit stress tester

Comments

@ahoppen
Copy link
Contributor

ahoppen commented Jan 17, 2022

Previous ID SR-15742
Radar rdar://87684281
Original Reporter @ahoppen
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash, FoundByStressTester
Assignee None
Priority Medium

md5: ddd1211125b9d74d76168f30e67db9b1

Issue Description:

The following test case fails with an llvm_unreachable these types are always canonical being executed.

// RUN: %sourcekitd-test -req=cursor -pos=5:36 %s -- %s

func fetch() {
  sryMap{ return try processResponse() }
  .napError{ parseError(reason: $0.abc()) }
}

func sryMap<String>(_ transform: () throws -> String) -> SryMap<String> {
  fatalError()
}

func processResponse() throws -> String { return "" }

func parseError(reason: String) {}

protocol MyError {}
extension MyError {
  func abc() -> String { return "" }
}

protocol MyProto {
  associatedtype Failure
}
extension MyProto {
  func napError(_ transform: (Self.Failure) -> Void) {}
}

struct SryMap<Output> : MyProto {
    typealias Failure = MyError
}

Bisecting determined that this was caused by #40666 (specifically commit ee331a8).

@hborla
Copy link
Member

hborla commented Jan 20, 2022

Here's the fix: #40925

@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
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 found by stress tester Flag: An issue found by the SourceKit stress tester
Projects
None yet
Development

No branches or pull requests

3 participants