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

Incorrect type inference when error occurred #145

Closed
VladD2 opened this issue Oct 22, 2011 · 1 comment
Closed

Incorrect type inference when error occurred #145

VladD2 opened this issue Oct 22, 2011 · 1 comment

Comments

@VladD2
Copy link
Member

VladD2 commented Oct 22, 2011

variant Test
{
  | Foo
  | Bar
}

module Program
{
  Main() : void
  {
    def fn(val : Test)
    {
      match (val)
      {
        | Foo => fn(null)
        | _ => val // E: can't cast Test to Test.Foo (incorrect)
      }
    }
    _ = match (fn(null))
    {
      | Test.Foo => w; // Real error
      | _ => "";
    }
  }
}
@rampelstinskin
Copy link
Contributor

Warning: // W: this match clause is unused
Incorrect.

@VladD2 VladD2 closed this as completed in 560245b Oct 22, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants