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

case guard using qualified constructor from other module does not compile #3883

Open
sbergen opened this issue Nov 23, 2024 · 1 comment · May be fixed by #3886
Open

case guard using qualified constructor from other module does not compile #3883

sbergen opened this issue Nov 23, 2024 · 1 comment · May be fixed by #3886
Labels
bug Something isn't working

Comments

@sbergen
Copy link

sbergen commented Nov 23, 2024

With module.gleam containing:

pub type Wibble {
  Wibble
  Wobble
}

and

import module

fn wibble(i: Int, w: module.Wibble) {
  case i {
    0 if w == module.Wobble -> 0
    _ -> 42
  }
}

compilation fails with

  │
5 │     0 if w == module.Wobble -> 0
  │                      ^^^^^^ I'm expecting a lowercase name here

If doing an unqualified import with

import module.{Wobble}

using w == Wobble works as expected.

Gleam version 1.6.1

@sbergen sbergen added the bug Something isn't working label Nov 23, 2024
@GearsDatapacks
Copy link
Member

I'll look into this

@GearsDatapacks GearsDatapacks linked a pull request Nov 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants