This is a known issue, and the only "workaround" is to re-implement the IndexOf method. The same aplpies to a couple of other heavily overloaded methods in the System.Array type.

The problem is that F# has no way to specify an explicit instantiation of a generic method. Since this is a generally useful feature we will implement that in preference to making adhoc changes to type inference to cope with this.

Thanks

Don

By on 9/18/2006 3:16 PM ()

Oh, another optionis to use the non-generic overload of the method, e.g.

1
2
3
4
5
 

let find (buffer: int[]) (item: int) : int = System.Array.IndexOf((buffer:>System.Array), item)

By on 9/18/2006 3:18 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper