-
Notifications
You must be signed in to change notification settings - Fork 833
Open
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendArea-Diagnosticsmistakes and possible improvements to diagnosticsmistakes and possible improvements to diagnosticsBug
Milestone
Description
Repro steps
let x (f: System.Action<int>) =
f.Invoke 99
f.Invoke 98
printfn "here"
let y () =
printfn "one time"
fun num -> printfn "%d" num
x (y ())Expected behavior
Prints
one time
99
98
here
which is what would've been printed with (f: int -> unit) instead of Action<int>
Actual behavior
Prints
one time
99
one time
98
here
because x (y ()) is unexpectedly(?) expanded into x (Action<int> (fun num -> y () num)).
Known workarounds
Bind y () first, manually wrap fun num ... in an Action, etc.
Related information
- SDK 10.0.100-rc.1.25451.107
adam-c-anderson
Metadata
Metadata
Assignees
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendArea-Diagnosticsmistakes and possible improvements to diagnosticsmistakes and possible improvements to diagnosticsBug
Type
Projects
Status
New