diff --git a/tests/fsharp/core/auto-widen/preview/test.bsl b/tests/fsharp/core/auto-widen/preview/test.bsl index 5b791a6d89a..947390ac100 100644 --- a/tests/fsharp/core/auto-widen/preview/test.bsl +++ b/tests/fsharp/core/auto-widen/preview/test.bsl @@ -635,4 +635,8 @@ test.fsx(543,36,543,37): typecheck error FS0001: All elements of a list must be test.fsx(544,14,544,21): typecheck error FS0039: The type 'float64' is not defined. Maybe you want one of the following: float - float32 \ No newline at end of file + float32 + +test.fsx(610,25,610,43): typecheck error FS3388: This expression implicitly converts type 'int -> unit' to type 'Action'. See https://aka.ms/fsharp-implicit-convs. + +test.fsx(617,18,617,22): typecheck error FS3388: This expression implicitly converts type 'int -> int' to type 'Func'. See https://aka.ms/fsharp-implicit-convs. \ No newline at end of file diff --git a/tests/fsharp/core/auto-widen/preview/test.fsx b/tests/fsharp/core/auto-widen/preview/test.fsx index 2e6454d13cd..c7c9520ef08 100644 --- a/tests/fsharp/core/auto-widen/preview/test.fsx +++ b/tests/fsharp/core/auto-widen/preview/test.fsx @@ -590,6 +590,47 @@ module TestRecursiveInferenceForPropagatingCases = // Check the return type of 'f' is known by the time we process "f().CompareTo(y)" let rec f() = { new System.IComparable with member x.CompareTo(y) = f().CompareTo(y) } +module MoreTests1 = + open System + + /// string -> unit + let print (s: string) = printfn "%s" s + + /// int -> string + let stringify (i: int) = string i + + /// int -> unit + let stringifyThenPrint = stringify >> print + + /// int -> unit + let doit (i: int) = stringifyThenPrint i + + // Action -> int -> unit + let actioner (a: Action) i = a.Invoke i + let bleh = actioner stringifyThenPrint + +module MoreTests2 = + type Test() = + //member this.Test(x) = x + 1 |> ignore + member this.Test(action : System.Func) = action.Invoke(1) + let test x = x + 1 + Test().Test (test) + +module MoreTests3 = + + type Test() = + //member this.Test(x) = x + 1 |> ignore + member this.Test(action : System.Func) = action.Invoke(1) + let test x = x + 1 + Test().Test (fun x -> test x) + +module MoreTests4 = + type Test() = + member this.Test(x) = x + 1 |> ignore + member this.Test(action : System.Func) = action.Invoke(1) + + let test x = x + 1 + Test().Test (test) printfn "test done"