File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1818#### :rocket : New Feature
1919- Add support for toplevel ` await ` https://github.com/rescript-lang/rescript-compiler/pull/6054
2020
21+ #### :nail_care : Polish
22+
23+ - Better error message for extension point https://github.com/rescript-lang/rescript-compiler/pull/6057
24+
2125# 10.1.3
2226
2327#### :rocket : New Feature
Original file line number Diff line number Diff line change @@ -69,12 +69,23 @@ let handle_debugger loc (payload : Ast_payload.t) =
6969 Ast_external_mk. local_external_apply loc ~pval_prim: [ " #debugger" ]
7070 ~pval_type: (Typ. arrow Nolabel (Typ. any () ) (Ast_literal. type_unit () ))
7171 [ Ast_literal. val_unit ~loc () ]
72- | _ -> Location. raise_errorf ~loc " bs.debugger does not accept payload"
72+ | _ ->
73+ Location. raise_errorf ~loc " %%debugger extension doesn't accept arguments"
7374
7475let handle_raw ~kind loc payload =
7576 let is_function = ref false in
7677 match Ast_payload. raw_as_string_exp_exn ~kind ~is_function payload with
77- | None -> Location. raise_errorf ~loc " bs.raw can only be applied to a string"
78+ | None -> (
79+ match kind with
80+ | Raw_re ->
81+ Location. raise_errorf ~loc
82+ " %%re extension can only be applied to a string"
83+ | Raw_exp ->
84+ Location. raise_errorf ~loc
85+ " %%raw extension can only be applied to a string"
86+ | Raw_program ->
87+ Location. raise_errorf ~loc
88+ " %%%%raw extension can only be applied to a string" )
7889 | Some exp ->
7990 {
8091 exp with
@@ -99,4 +110,6 @@ let handle_raw_structure loc payload =
99110 ~pval_type: (Typ. arrow Nolabel (Typ. any () ) (Typ. any () ))
100111 [ exp ];
101112 }
102- | None -> Location. raise_errorf ~loc " bs.raw can only be applied to a string"
113+ | None ->
114+ Location. raise_errorf ~loc
115+ " %%%%raw extension can only be applied to a string"
You can’t perform that action at this time.
0 commit comments