gleam-lang/gleam

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

Open

#2,550 建立於 2024年1月17日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Rust (960 fork)batch import
help wantedhigh priority

倉庫指標

Star
 (21,417 star)
PR 合併指標
 (平均合併 10天 19小時) (30 天內合併 69 個 PR)

描述

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

貢獻者指南