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

Patterns in if case avoid MiscDiagnostics #75389

Open
hamishknight opened this issue Jul 21, 2024 · 0 comments
Open

Patterns in if case avoid MiscDiagnostics #75389

hamishknight opened this issue Jul 21, 2024 · 0 comments
Assignees
Labels
accepts invalid Bug: Accepts invalid bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself enum case patterns Feature → patterns: Enumeration case patterns patterns Feature: patterns swift 6.0 type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Contributor

The following is incorrectly allowed to compile:

@available(*, unavailable)
func foo() -> Int { 0 }

func bar() {
  if case foo() = 0 {}
}
@hamishknight hamishknight added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself type checker Area → compiler: Semantic analysis accepts invalid Bug: Accepts invalid labels Jul 21, 2024
@hamishknight hamishknight self-assigned this Jul 21, 2024
@AnthonyLatsis AnthonyLatsis added swift 6.0 patterns Feature: patterns enum case patterns Feature → patterns: Enumeration case patterns labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepts invalid Bug: Accepts invalid bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself enum case patterns Feature → patterns: Enumeration case patterns patterns Feature: patterns swift 6.0 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants