File tree 6 files changed +34
-6
lines changed
tests/parsing/grammar/expressions
6 files changed +34
-6
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ These are only breaking changes for unformatted code.
40
40
41
41
#### :nail_care : Polish
42
42
43
- - Syntax: process uncurried types explicitly in the parser/printer https://github.com/rescript-lang/rescript-compiler/pull/5784
43
+ - Syntax: process uncurried types explicitly in the parser/printer https://github.com/rescript-lang/rescript-compiler/pull/5784 https://github.com/rescript-lang/rescript-compiler/pull/5822
44
44
- Syntax: process uncurried function declarations explicitly in the parser/printer https://github.com/rescript-lang/rescript-compiler/pull/5794
45
45
- PPX V4: allow uncurried ` make ` function and treat it like a curried one [ #5802 ] ( https://github.com/rescript-lang/rescript-compiler/pull/5802 ) [ #5808 ] ( https://github.com/rescript-lang/rescript-compiler/pull/5808 ) [ #5812 ] ( https://github.com/rescript-lang/rescript-compiler/pull/5812 )
46
46
Original file line number Diff line number Diff line change @@ -166277,6 +166277,7 @@ and parsePolyTypeExpr p =
166277
166277
let startPos = p.Parser.startPos in
166278
166278
match p.Parser.token with
166279
166279
| SingleQuote -> (
166280
+ (* XX here *)
166280
166281
let vars = parseTypeVarList p in
166281
166282
match vars with
166282
166283
| _v1 :: _v2 :: _ ->
@@ -166296,7 +166297,12 @@ and parsePolyTypeExpr p =
166296
166297
let typ = Ast_helper.Typ.var ~loc:var.loc var.txt in
166297
166298
let returnType = parseTypExpr ~alias:false p in
166298
166299
let loc = mkLoc typ.Parsetree.ptyp_loc.loc_start p.prevEndPos in
166299
- Ast_helper.Typ.arrow ~loc Asttypes.Nolabel typ returnType
166300
+ let tFun = Ast_helper.Typ.arrow ~loc Asttypes.Nolabel typ returnType in
166301
+ if p.uncurried_by_default then
166302
+ Ast_helper.Typ.constr ~loc
166303
+ {txt = Ldot (Ldot (Lident "Js", "Fn"), "arity1"); loc}
166304
+ [tFun]
166305
+ else tFun
166300
166306
| _ -> Ast_helper.Typ.var ~loc:var.loc var.txt)
166301
166307
| _ -> assert false)
166302
166308
| _ -> parseTypExpr p
Original file line number Diff line number Diff line change @@ -179709,6 +179709,7 @@ and parsePolyTypeExpr p =
179709
179709
let startPos = p.Parser.startPos in
179710
179710
match p.Parser.token with
179711
179711
| SingleQuote -> (
179712
+ (* XX here *)
179712
179713
let vars = parseTypeVarList p in
179713
179714
match vars with
179714
179715
| _v1 :: _v2 :: _ ->
@@ -179728,7 +179729,12 @@ and parsePolyTypeExpr p =
179728
179729
let typ = Ast_helper.Typ.var ~loc:var.loc var.txt in
179729
179730
let returnType = parseTypExpr ~alias:false p in
179730
179731
let loc = mkLoc typ.Parsetree.ptyp_loc.loc_start p.prevEndPos in
179731
- Ast_helper.Typ.arrow ~loc Asttypes.Nolabel typ returnType
179732
+ let tFun = Ast_helper.Typ.arrow ~loc Asttypes.Nolabel typ returnType in
179733
+ if p.uncurried_by_default then
179734
+ Ast_helper.Typ.constr ~loc
179735
+ {txt = Ldot (Ldot (Lident "Js", "Fn"), "arity1"); loc}
179736
+ [tFun]
179737
+ else tFun
179732
179738
| _ -> Ast_helper.Typ.var ~loc:var.loc var.txt)
179733
179739
| _ -> assert false)
179734
179740
| _ -> parseTypExpr p
Original file line number Diff line number Diff line change @@ -3890,6 +3890,7 @@ and parsePolyTypeExpr p =
3890
3890
let startPos = p.Parser. startPos in
3891
3891
match p.Parser. token with
3892
3892
| SingleQuote -> (
3893
+ (* XX here *)
3893
3894
let vars = parseTypeVarList p in
3894
3895
match vars with
3895
3896
| _v1 :: _v2 :: _ ->
@@ -3909,7 +3910,12 @@ and parsePolyTypeExpr p =
3909
3910
let typ = Ast_helper.Typ. var ~loc: var.loc var.txt in
3910
3911
let returnType = parseTypExpr ~alias: false p in
3911
3912
let loc = mkLoc typ.Parsetree. ptyp_loc.loc_start p.prevEndPos in
3912
- Ast_helper.Typ. arrow ~loc Asttypes. Nolabel typ returnType
3913
+ let tFun = Ast_helper.Typ. arrow ~loc Asttypes. Nolabel typ returnType in
3914
+ if p.uncurried_by_default then
3915
+ Ast_helper.Typ. constr ~loc
3916
+ {txt = Ldot (Ldot (Lident " Js" , " Fn" ), " arity1" ); loc}
3917
+ [tFun]
3918
+ else tFun
3913
3919
| _ -> Ast_helper.Typ. var ~loc: var.loc var.txt)
3914
3920
| _ -> assert false )
3915
3921
| _ -> parseTypExpr p
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ type upp = (. ()) => (. ()) => int
31
31
type uu2 = (. unit , unit ) => unit
32
32
type up2 = (. (), ()) => unit
33
33
34
+ let uannpoly : (. 'a ) => string = xx
35
+ let uannint : (. int ) => string = xx
36
+
34
37
@@uncurried
35
38
36
39
let cApp = foo (. 3 )
@@ -67,4 +70,7 @@ type upp = () => () => int
67
70
type uu2 = (unit , unit ) => unit
68
71
type up2 = ((), ()) => unit
69
72
70
- let pipe1 = 3 -> f
73
+ let pipe1 = 3 -> f
74
+
75
+ let uannpoly : 'a => string = xx
76
+ let uannint : int => string = xx
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ type nonrec uup = (unit -> int Js.Fn.arity0) Js.Fn.arity1
40
40
type nonrec upp = int Js.Fn.arity0 Js.Fn.arity0
41
41
type nonrec uu2 = (unit -> unit -> unit) Js.Fn.arity2
42
42
type nonrec up2 = (unit -> unit -> unit) Js.Fn.arity2
43
+ let (uannpoly : ('a -> string) Js.Fn.arity1) = xx
44
+ let (uannint : (int -> string) Js.Fn.arity1) = xx
43
45
[@@@uncurried ]
44
46
let cApp = foo 3
45
47
let uApp = ((foo 3)[@bs ])
@@ -84,4 +86,6 @@ type nonrec uup = (unit -> int Js.Fn.arity0) Js.Fn.arity1
84
86
type nonrec upp = int Js.Fn.arity0 Js.Fn.arity0
85
87
type nonrec uu2 = (unit -> unit -> unit) Js.Fn.arity2
86
88
type nonrec up2 = (unit -> unit -> unit) Js.Fn.arity2
87
- let pipe1 = 3 |.u f
89
+ let pipe1 = 3 |.u f
90
+ let (uannpoly : ('a -> string) Js.Fn.arity1) = xx
91
+ let (uannint : (int -> string) Js.Fn.arity1) = xx
You can’t perform that action at this time.
0 commit comments