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-9920] Compiler error when an empty "return" precedes an "@unknown default" case. #52326

Closed
swift-ci opened this issue Feb 14, 2019 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-9920
Radar rdar://problem/48634159
Original Reporter pappy (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Version 10.2 beta 2 (10P91b)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee @belkadan
Priority Medium

md5: b2a20da52a07f32a58733f33075263f5

is duplicated by:

  • SR-11014 Using a void return immediately before an @unknown default results in a compilation error

Issue Description:

Imagine enum is a non-exhaustive enum.

switch enum {

{{ case .blah: return}}

@unknown default: break

{{}}}

Results in an "expected expression in 'return' statement"

Adding a semicolon makes the error go away, but ew.

@belkadan
Copy link
Contributor

#22974

@belkadan
Copy link
Contributor

belkadan commented Mar 1, 2019

Fixed, though I'm afraid that won't make it into 5.0, since there's a workaround.

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

No branches or pull requests

2 participants