gleam-lang/gleam

Type inference issue expected Test(a) but found Test(a)

Open

#2550 aperta il 17 gen 2024

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)Rust (960 fork)batch import
help wantedhigh priority

Metriche repository

Star
 (21.417 star)
Metriche merge PR
 (Merge medio 10g 19h) (69 PR mergiate in 30 g)

Descrizione

type Test(a) {
  Test(a)
}
fn it(value: Test(a)) {
  it2(value)
}
fn it2(value: Test(a)) -> Test(a) {
  it(value)
}

Gives this error on the test2 call

Type mismatch

The type of this returned value doesn't match the return type
annotation of this function.

Expected type:

    Test(a)

Found type:

    Test(a)

Similar issue #1893

Guida contributor