File tree Expand file tree Collapse file tree 6 files changed +40
-4
lines changed
syntax_tests/data/parsing/grammar/expressions Expand file tree Collapse file tree 6 files changed +40
-4
lines changed Original file line number Diff line number Diff line change 2323- Rewatch: warnings for unsupported/unknown rescript.json fields. https://github.com/rescript-lang/rescript/pull/8031
2424- Fix missing ` ignore ` function in some Stdlib modules. https://github.com/rescript-lang/rescript/pull/8060
2525- Fix signature matching for externals when abstract alias hides function arity. https://github.com/rescript-lang/rescript/pull/8045
26+ - Fix arity detection for arrows returning nested generics. https://github.com/rescript-lang/rescript/pull/8064
2627
2728#### :memo : Documentation
2829
Original file line number Diff line number Diff line change @@ -362,8 +362,10 @@ let is_es6_arrow_expression ~in_ternary p =
362362 (match state.Parser. token with
363363 (* arrived at `() :typ<` here *)
364364 | LessThan ->
365+ Scanner. set_diamond_mode state.scanner;
365366 Parser. next state;
366- go_to_closing GreaterThan state
367+ go_to_closing GreaterThan state;
368+ Scanner. pop_mode state.scanner Diamond
367369 | _ -> () );
368370 match state.Parser. token with
369371 (* arrived at `() :typ =>` or `() :typ<'a,'b> =>` here *)
Original file line number Diff line number Diff line change @@ -107,4 +107,6 @@ let arr = (): array<nullable<int>> => []
107107
108108let fn = f => f ;
109109type f = int => unit ;
110- let a = fn (_ => (): f );
110+ let a = fn (_ => (): f );
111+
112+ let returnsArrayOption = (): option <array <string >> => Some (["foo" ])
Original file line number Diff line number Diff line change @@ -74,7 +74,9 @@ type nonrec u = unit
7474let un = (() : u)
7575type nonrec ('a, 'b) d = ('a * 'b)
7676let c [arity:1]() = ((1, 2) : ('a, 'b) d)
77- let arr () = ([||] : int nullable array)
77+ let arr [arity:1] () = ([||] : int nullable array)
7878let fn [arity:1]f = f
7979type nonrec f = int -> unit (a:1)
80- let a = fn (fun [arity:1]_ -> () : f)
80+ let a = fn (fun [arity:1]_ -> () : f)
81+ let returnsArrayOption [arity:1]() =
82+ (Some [|{js|foo|js}|] : string array option)
Original file line number Diff line number Diff line change 1+ // Generated by ReScript, PLEASE EDIT WITH CARE
2+
3+
4+ function foo ( ) {
5+ return [ "foo" ] ;
6+ }
7+
8+ let bar = [ "foo" ] ;
9+
10+ function nested ( ) {
11+ return 1 ;
12+ }
13+
14+ let baz = 1 ;
15+
16+ export {
17+ foo ,
18+ bar ,
19+ nested ,
20+ baz ,
21+ }
22+ /* No side effect */
Original file line number Diff line number Diff line change 1+ // https://github.com/rescript-lang/rescript/issues/8055
2+
3+ let foo = (): option <array <string >> => Some (["foo" ])
4+ let bar = foo ()
5+
6+ let nested = (): option <option <int >> => Some (Some (1 ))
7+ let baz = nested ()
You can’t perform that action at this time.
0 commit comments