fork download
  1. type Foo () = class end
  2. type Bar () = inherit Foo ()
  3.  
  4. type FooCollection () = class end // not really necessary
  5.  
  6. type Test1 () =
  7. static member AddRange (col: FooCollection) = () // could be an int or anything instead
  8. static member AddRange (foos: Foo []) = ()
  9.  
  10. type Test2 () = static member AddRange (foos: Foo []) = ()
  11.  
  12. // won't compile
  13. //Test1.AddRange [|Bar ()|] // error: have to explicitely cast => [|Bar () :> Foo|]
  14.  
  15. Test2.AddRange [|Bar ()|] // works
  16.  
Success #stdin #stdout 0.02s 23192KB
stdin
Standard input is empty
stdout
Standard output is empty