This is because in F# you cannot overload a method with the same number of arguments with specifying an 'OverloadID' attribute. This doesn't have any real purpose other than helping the compiler out and may be removed in future releases of the language.

1
2
3
4
5
6
7
8
9
#light
open System
type Date =
  val i : int64 ;
  [<OverloadID("1")>]
  new(j : DateTime) as this = new Date(j.Ticks)
  [<OverloadID("2")>]
  new(j: int64) as this = {i=j}
By on 1/28/2008 4:12 PM ()

That's the ticket, thanks. Irritating, because I read that in the book.

Cheers,
Sam

By on 1/29/2008 5:12 AM ()
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