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

Pattern Matching : Wrong & Inconsistent exhaustivity warning #17184

Closed
ftucky opened this issue Mar 30, 2023 · 0 comments · Fixed by #18252
Closed

Pattern Matching : Wrong & Inconsistent exhaustivity warning #17184

ftucky opened this issue Mar 30, 2023 · 0 comments · Fixed by #18252

Comments

@ftucky
Copy link

ftucky commented Mar 30, 2023

Compiler version

3.2.2, 3.3.0-RC3, 3.3.1-RC1-bin-20230328-5c2efc5-NIGHTLY

Minimized code

class Foo
trait Bar:
  val foo : Int
  val f : Option[foo.type] = Some(foo)

  def g : Boolean = 
    f match 
      case None => false
      case Some(_) => true

Output

Warning : 
match may not be exhaustive.

It would fail on pattern case: Some(_)

Expectation

No warning : case Some(_) is recited.

@ftucky ftucky added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 30, 2023
@dwijnand dwijnand added area:pattern-matching and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 31, 2023
@dwijnand dwijnand self-assigned this Mar 31, 2023
@dwijnand dwijnand linked a pull request Jul 19, 2023 that will close this issue
@Kordyjan Kordyjan added this to the 3.4.0 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants