gleam-lang/gleam

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

Open

#2,550 opened on 2024年1月17日

GitHub で見る
 (3 comments) (0 reactions) (0 assignees)Rust (960 forks)batch import
help wantedhigh priority

Repository metrics

Stars
 (21,417 stars)
PR merge metrics
 (平均マージ 10d 19h) (30d で 69 merged PRs)

説明

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

コントリビューターガイド