gleam-lang/gleam

Emphasize mismatching part of complex type mismatches

Open

#4,578 建立於 2025年5月9日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)Rust (960 fork)batch import
discussionhelp wanted

倉庫指標

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

描述

When a type mismatch is complex, and some types are unbound (is this the correct term?), it can be hard to see where the error actually is. Here is a concrete example I actually wasted quite a bit of time on:

Expected type:

    drift.Step(List(String), Input, Output, Nil)

Found type:

    drift.Step(List(string), Input, a, b)

It could be made clearer by emphasizing where the type mismatch was exactly:

Expected type:

    drift.Step(List(String), Input, Output, Nil)
                    ^^^^^^

Found type:

    drift.Step(List(string), Input, a, b)
                    ^^^^^^

貢獻者指南