Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tests/fsharp/core/auto-widen/preview/test.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -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
float32

test.fsx(610,25,610,43): typecheck error FS3388: This expression implicitly converts type 'int -> unit' to type 'Action<int>'. 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<int,int>'. See https://aka.ms/fsharp-implicit-convs.
41 changes: 41 additions & 0 deletions tests/fsharp/core/auto-widen/preview/test.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -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> -> int -> unit
let actioner (a: Action<int>) 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<int, int>) = 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<int, int>) = 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<int, int>) = action.Invoke(1)

let test x = x + 1
Test().Test (test)

printfn "test done"

Expand Down