A small piece of code to highlight the problem:
open System.IO
let do_smth i (stm : #System.IO.Stream) =
(*....*)
()
type SomeOps = SomeOps with
static member op (i : int) = do_smth i
let test_currying i = do_smth i
let main() =
use stm = new System.IO.MemoryStream()
test_currying 42 stm
SomeOps.op 42 stm
Can someone explain why the behavior of the compiler is so different in the last two lines? And why did we lose information (about flexibility #Stream) in a function test_currying?
qehgt source
share