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-8533] Enum switch regression since the toolchain shipped in Xcode 10 beta 5 #51052

Open
Dante-Broggi opened this issue Aug 14, 2018 · 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

Comments

@Dante-Broggi
Copy link
Contributor

Previous ID SR-8533
Radar None
Original Reporter @Dante-Broggi
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, CompilerCrash
Assignee None
Priority Medium

md5: cd7bbdd5399d04f914d96c95335d9dac

Issue Description:

In the Xcode 10 beta 5 toolchain, the following works `correctly`.

In the DEVELOPMENT-SNAPSHOT-2018-08-10, it crashes the compiler with an "Abort trap: 6", and

"Assertion failed (![](foundElement && "ambiguity in enum case name lookup?)"), function filterForEnumElement, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/swift/lib/Sema/TypeCheckPattern.cpp, line 98."

enum Foo {
  case doz
  case foo(bar: Int)
  case foo(baz: Int)
}


let foz = Foo.foo(baz:)


switch foz(1) {
case .foo(let bar):
  print(bar)
case .doz:
  break
}
@belkadan
Copy link
Contributor

Xcode toolchains don't have assertions enabled, so it's probably not working there either. It's also pretty disconcerting that that not-fully-covered switch is allowed.

cc CodaFi (JIRA User)

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

No branches or pull requests

3 participants