Skip to content

Commit 1241a43

Browse files
committed
Test uncurried cast idea.
When curried application is used for an uncurried function, instead of a type error one gets a curried partial application. This allows e.g. to define curried library functions such as `raise` and use them both with curried and uncurried application.
1 parent 84e8f41 commit 1241a43

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

jscomp/ml/typecore.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,6 +2988,7 @@ and type_application env funct (sargs : sargs) : targs * Types.type_expr =
29882988
Location.prerr_warning sarg1.pexp_loc Warnings.Unused_argument;
29892989
unify env ty_fun (newty (Tarrow(l1,t1,t2,Clink(ref Cunknown))));
29902990
(t1, t2)
2991+
| Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),[{desc=Tarrow (l,t1,t2,_)}],_)
29912992
| Tarrow (l,t1,t2,_) when Asttypes.same_arg_label l l1
29922993
->
29932994
(t1, t2)

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43686,6 +43686,7 @@ and type_application env funct (sargs : sargs) : targs * Types.type_expr =
4368643686
Location.prerr_warning sarg1.pexp_loc Warnings.Unused_argument;
4368743687
unify env ty_fun (newty (Tarrow(l1,t1,t2,Clink(ref Cunknown))));
4368843688
(t1, t2)
43689+
| Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),[{desc=Tarrow (l,t1,t2,_)}],_)
4368943690
| Tarrow (l,t1,t2,_) when Asttypes.same_arg_label l l1
4369043691
->
4369143692
(t1, t2)

lib/4.06.1/unstable/js_playground_compiler.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43686,6 +43686,7 @@ and type_application env funct (sargs : sargs) : targs * Types.type_expr =
4368643686
Location.prerr_warning sarg1.pexp_loc Warnings.Unused_argument;
4368743687
unify env ty_fun (newty (Tarrow(l1,t1,t2,Clink(ref Cunknown))));
4368843688
(t1, t2)
43689+
| Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),[{desc=Tarrow (l,t1,t2,_)}],_)
4368943690
| Tarrow (l,t1,t2,_) when Asttypes.same_arg_label l l1
4369043691
->
4369143692
(t1, t2)

lib/4.06.1/whole_compiler.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98681,6 +98681,7 @@ and type_application env funct (sargs : sargs) : targs * Types.type_expr =
9868198681
Location.prerr_warning sarg1.pexp_loc Warnings.Unused_argument;
9868298682
unify env ty_fun (newty (Tarrow(l1,t1,t2,Clink(ref Cunknown))));
9868398683
(t1, t2)
98684+
| Tconstr (Pdot (Pdot(Pident {name = "Js"},"Fn",_),_,_),[{desc=Tarrow (l,t1,t2,_)}],_)
9868498685
| Tarrow (l,t1,t2,_) when Asttypes.same_arg_label l l1
9868598686
->
9868698687
(t1, t2)

0 commit comments

Comments
 (0)