This is not about window shapes, but only for the "background".
I played in Windows Forms when I got an error in AddRange for MenuStrip.Items requiring dropping ToolStripMenuItem in ToolStripItem
But I already have AddRange for Form.Controls , before which no drops were required.
After a little experiment, I managed to find that an error occurs when there are several overloads for this AddRange , so I tried to check my thoughts:
type Foo () = class end type Bar () = inherit Foo () type FooCollection () = class end // not really necessary type Test1 () = member __.AddRange (col: FooCollection) = () // could be an int or anything instead member __.AddRange (foos: Foo []) = () type Test2 () = member __.AddRange (foos: Foo []) = () let lst1, lst2 = Test1 (), Test2 () lst1.AddRange [|Bar ()|] // error: have to explicitely cast => [|Bar () :> Foo|] lst2.AddRange [|Bar ()|] // works
The question is simply why; from my point of view, the call is not ambiguous
casting method-overloading f # overload-resolution ambiguous-call
Sehnsucht
source share