File tree 4 files changed +20
-3
lines changed
tests/syntax_tests/data/printer/signature 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 36
36
- Remove deprecated pipe last (` |> ` ) syntax. https://github.com/rescript-lang/rescript/pull/7512
37
37
- Improve error message for pipe (` -> ` ) syntax. https://github.com/rescript-lang/rescript/pull/7520
38
38
- Improve a few error messages around various subtyping issues. https://github.com/rescript-lang/rescript/pull/7404
39
+ - In module declarations, accept the invalid syntax ` M = {...} ` and format it to ` M : {...} ` . https://github.com/rescript-lang/rescript/pull/7527
40
+
41
+ #### :house : Internal
42
+
39
43
- Refactor the ast for record expressions and patterns. https://github.com/rescript-lang/rescript/pull/7528
40
44
41
45
# 12.0.0-alpha.13
Original file line number Diff line number Diff line change @@ -6541,10 +6541,15 @@ and parse_module_declaration_or_alias ~attrs p =
6541
6541
| Colon ->
6542
6542
Parser. next p;
6543
6543
parse_module_type p
6544
- | Equal ->
6544
+ | Equal -> (
6545
6545
Parser. next p;
6546
- let lident = parse_module_long_ident ~lowercase: false p in
6547
- Ast_helper.Mty. alias lident
6546
+ match p.Parser. token with
6547
+ | Lbrace ->
6548
+ (* Parse `module M = {` as `module M : {` *)
6549
+ parse_module_type p
6550
+ | _ ->
6551
+ let lident = parse_module_long_ident ~lowercase: false p in
6552
+ Ast_helper.Mty. alias lident)
6548
6553
| token ->
6549
6554
Parser. err p (Diagnostics. unexpected token p.breadcrumbs);
6550
6555
Recover. default_module_type ()
Original file line number Diff line number Diff line change @@ -23,3 +23,8 @@ module LongNaaaaame: MyModule
23
23
24
24
@attr
25
25
module LinkedList: module type of List
26
+
27
+ // turn `=` into `:`
28
+ module M: {
29
+ let x: int
30
+ }
Original file line number Diff line number Diff line change @@ -24,3 +24,6 @@ module LongNaaaaame: MyModule
24
24
25
25
@attr
26
26
module LinkedList: module type of List
27
+
28
+ // turn `=` into `:`
29
+ module M = { let x: int }
You can’t perform that action at this time.
0 commit comments