diff --git a/test/passing/tests/function_constraint.ml b/test/passing/tests/function_constraint.ml index 30459ed817..cb62dbc9f1 100644 --- a/test/passing/tests/function_constraint.ml +++ b/test/passing/tests/function_constraint.ml @@ -1,19 +1,34 @@ -let f = fun (type a) -> (() : unit) +(* RHS annotated with a type *) +let f (type a) = (() : unit) -let f = fun (type a : immediate) -> (() : unit) +let f (type a : immediate) = (() : unit) -let f = fun (type a) x -> (() : unit) +let f x y = (() : unit) -let f = fun x y -> (() : unit) +(* RHS annotated with a type and mode *) +let f (type a) = (() : unit @@ local) -let f = fun (type a : value) x -> (() : unit) +let f (type a : value) = (() : unit @@ local) -let f = fun (type a) -> (() : unit @@ local) +let f x y = (() : unit @@ local) -let f = fun (type a : immediate) -> (() : unit @@ local) +(* LHS and RHS annotated with the same type *) +let f (type a) : unit = (() : unit) -let f = fun (type a) x -> (() : unit @@ local) +let f (type a : value) : unit = (() : unit) -let f = fun x y -> (() : unit @@ local) +let f x y : unit = (() : unit) -let f = fun (type a : value) x -> (() : unit @@ local) +(* LHS and RHS annotated with different types *) +let f (type a) : unit = (() : int) + +let f (type a : value) : unit = (() : int) + +let f x y : unit = (() : int) + +(* LHS annotated with a mode, RHS annotated with a type *) +let (f @ local) (type a) = (() : unit) + +let (f @ local) (type a : value) = (() : unit) + +let (f @ local) x y = (() : unit) diff --git a/test/passing/tests/function_constraint.ml.js-ref b/test/passing/tests/function_constraint.ml.js-ref index aa3a05a598..08dde1fdbe 100644 --- a/test/passing/tests/function_constraint.ml.js-ref +++ b/test/passing/tests/function_constraint.ml.js-ref @@ -1,10 +1,24 @@ +(* RHS annotated with a type *) let f (type a) : unit = () let f (type a : immediate) : unit = () -let f (type a) x : unit = () let f x y : unit = () -let f (type a : value) x : unit = () + +(* RHS annotated with a type and mode *) let f (type a) = (() : unit @@ local) -let f (type a : immediate) = (() : unit @@ local) -let f (type a) x = (() : unit @@ local) +let f (type a : value) = (() : unit @@ local) let f x y = (() : unit @@ local) -let f (type a : value) x = (() : unit @@ local) + +(* LHS and RHS annotated with the same type *) +let f (type a) : unit = (() : unit) +let f (type a : value) : unit = (() : unit) +let f x y : unit = (() : unit) + +(* LHS and RHS annotated with different types *) +let f (type a) : unit = (() : int) +let f (type a : value) : unit = (() : int) +let f x y : unit = (() : int) + +(* LHS annotated with a mode, RHS annotated with a type *) +let (f @ local) (type a) : unit = () +let (f @ local) (type a : value) : unit = () +let (f @ local) x y : unit = () diff --git a/test/passing/tests/function_constraint.ml.ref b/test/passing/tests/function_constraint.ml.ref index ee46d77d01..9bc3b33198 100644 --- a/test/passing/tests/function_constraint.ml.ref +++ b/test/passing/tests/function_constraint.ml.ref @@ -1,19 +1,34 @@ +(* RHS annotated with a type *) let f (type a) : unit = () let f (type a : immediate) : unit = () -let f (type a) x : unit = () - let f x y : unit = () -let f (type a : value) x : unit = () - +(* RHS annotated with a type and mode *) let f (type a) = (() : unit @@ local) -let f (type a : immediate) = (() : unit @@ local) - -let f (type a) x = (() : unit @@ local) +let f (type a : value) = (() : unit @@ local) let f x y = (() : unit @@ local) -let f (type a : value) x = (() : unit @@ local) +(* LHS and RHS annotated with the same type *) +let f (type a) : unit = (() : unit) + +let f (type a : value) : unit = (() : unit) + +let f x y : unit = (() : unit) + +(* LHS and RHS annotated with different types *) +let f (type a) : unit = (() : int) + +let f (type a : value) : unit = (() : int) + +let f x y : unit = (() : int) + +(* LHS annotated with a mode, RHS annotated with a type *) +let (f @ local) (type a) : unit = () + +let (f @ local) (type a : value) : unit = () + +let (f @ local) x y : unit = ()