From 61174970a46960aef3cf0f32d9784a7c12701cdc Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 25 May 2025 10:18:27 +0200 Subject: [PATCH 1/2] Improve error message for pipe syntax --- compiler/frontend/ast_exp_apply.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/frontend/ast_exp_apply.ml b/compiler/frontend/ast_exp_apply.ml index afffea4e3c..04034fad51 100644 --- a/compiler/frontend/ast_exp_apply.ml +++ b/compiler/frontend/ast_exp_apply.ml @@ -197,7 +197,8 @@ let app_exp_mapper (e : exp) (self : Bs_ast_mapper.mapper) : exp = | _ -> Location.raise_errorf ~loc "invalid #= assignment")) | Some {op = "->"; loc} -> Location.raise_errorf ~loc - "invalid |. syntax, it can only be used as binary operator" + "Invalid pipe syntax. The pipe symbol (->) can only be used as a binary \ + operator." | Some {op = "##"; loc} -> Location.raise_errorf ~loc "Js object ## expect syntax like obj##(paint (a,b)) " From 2c78555448306147f421bc5e8ead0d7deb98fbed Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 25 May 2025 10:56:52 +0200 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6088034e6..c54e9acc83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,8 @@ - Allow oneliner formatting when including module with single type alias. https://github.com/rescript-lang/rescript/pull/7502 - 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 - Show in error messages when coercion can be used to fix a type mismatch. https://github.com/rescript-lang/rescript/pull/7505 -- Remove deprecated pipe last (|>) syntax. https://github.com/rescript-lang/rescript/pull/7512 +- Remove deprecated pipe last (`|>`) syntax. https://github.com/rescript-lang/rescript/pull/7512 +- Improve error message for pipe (`->`) syntax. https://github.com/rescript-lang/rescript/pull/7520 # 12.0.0-alpha.13