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