gleam-lang/gleam

Emphasize mismatching part of complex type mismatches

Open

#4.578 geöffnet am 9. Mai 2025

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (960 Forks)batch import
discussionhelp wanted

Repository-Metriken

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

Beschreibung

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)
                    ^^^^^^

Contributor Guide