gleam-lang/gleam

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

Open

#2.550 geöffnet am 17. Jan. 2024

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (960 Forks)batch import
help wantedhigh priority

Repository-Metriken

Stars
 (21.417 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 10T 19h) (69 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide