Skip to content

Commit 7d3a0d0

Browse files
authored
Improve error message for pipe syntax (#7520)
1 parent f985ab1 commit 7d3a0d0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
- Allow oneliner formatting when including module with single type alias. https://github.com/rescript-lang/rescript/pull/7502
3131
- Improve error messages for JSX type mismatches, passing objects where record is expected, passing array literal where tuple is expected, and more. https://github.com/rescript-lang/rescript/pull/7500
3232
- Show in error messages when coercion can be used to fix a type mismatch. https://github.com/rescript-lang/rescript/pull/7505
33-
- Remove deprecated pipe last (|>) syntax. https://github.com/rescript-lang/rescript/pull/7512
33+
- Remove deprecated pipe last (`|>`) syntax. https://github.com/rescript-lang/rescript/pull/7512
34+
- Improve error message for pipe (`->`) syntax. https://github.com/rescript-lang/rescript/pull/7520
3435

3536
# 12.0.0-alpha.13
3637

compiler/frontend/ast_exp_apply.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ let app_exp_mapper (e : exp) (self : Bs_ast_mapper.mapper) : exp =
197197
| _ -> Location.raise_errorf ~loc "invalid #= assignment"))
198198
| Some {op = "->"; loc} ->
199199
Location.raise_errorf ~loc
200-
"invalid |. syntax, it can only be used as binary operator"
200+
"Invalid pipe syntax. The pipe symbol (->) can only be used as a binary \
201+
operator."
201202
| Some {op = "##"; loc} ->
202203
Location.raise_errorf ~loc
203204
"Js object ## expect syntax like obj##(paint (a,b)) "

0 commit comments

Comments
 (0)