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

贡献者指南