You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Diagnostics: the two spellings of an effect (IO<Unit> vs IO(Unit)) both point the wrong way #1848
Bend 2.0.38. An effect application has two spellings that a newcomer mixes up constantly: the type is written with parentheses (IO(Unit)) and the do-block with angle brackets (do IO<Unit>:). Each mistake produces a diagnostic that does not name the pair or the position, so the fix is not discoverable from the message.
Repro 1 — the return type written with angle brackets:
Syntactically true, but it says neither what to write nor that the angle form belongs to the do-block while the paren form belongs to the type.
Suggested messages, in the shape of the existing diagnostics:
Repro 1: the type of an effect is written with parentheses: IO(Unit), not IO<Unit> (the angle form is the do-block's)
Repro 2: a do-block takes the angle form: do IO<Unit>:
Both repros are one token away from a working program; the two spellings are the same distinction, so one message could even name the other. Related: #1632 (the diagnostic proposals thread). Happy to send PRs for either message if the wording is agreed — the sites are the type parser and the do-parser.
This is fixed by #1835 (fix/io-effect-spelling). I ran that branch's compiler on this issue's two repro files: both messages land exactly as the PR's pinned tests say — the return-type case names the pair (a type: IO<...>is the do block's effect syntax; a return type is writtenIO(...)) and the do-block case reports `expected : an effect's arguments in `<...> at the paren — and the correct IO(Unit) / do IO<Unit>: program still compiles. The special case is narrow (only IO; other unknown names keep the old message), so it does not over-reach.
Activity
adeerkhan commentedon Oct 25, 2026
This is fixed by #1835 (
fix/io-effect-spelling). I ran that branch's compiler on this issue's two repro files: both messages land exactly as the PR's pinned tests say — the return-type case names the pair (a type:IO<...>is the do block's effect syntax; a return type is writtenIO(...)) and the do-block case reports `expected : an effect's arguments in `<...>at the paren — and the correctIO(Unit)/do IO<Unit>:program still compiles. The special case is narrow (onlyIO; other unknown names keep the old message), so it does not over-reach.YidaWeng commentedon Oct 28, 2026
This looks fixed on
mainby #1865 (which superseded #1835).I re-ran both repros from the issue body with current
main(52637f74):Repro 1 (
def main() -> IO<Unit>:):Repro 2 (
do IO(Unit):):Both name the type vs do-block spelling pair now. Happy to see this closed if that matches what you wanted.
YidaWeng commentedon Oct 28, 2026
Closing as fixed by #1865 (verified on main).
YidaWeng commentedon Oct 28, 2026
(Follow-up: I don't have permission to close issues here. Maintainers: please close if the #1865 messages above are enough.)