I think that it's expected behavior. A flexible type annotation implicitly defines a type variable; however type definitions must explicitly declare all type variables that they use. For the same reason, this won't work:

1
2
3
4
type T(x:'a) =

  ...
By on 1/16/2011 12:33 PM ()

Ahhhaaa... Moving the flexible type parameter and the up-cast to the static factory method, of cause, works perfectly.

Although "common sense" tells me that it is the constructor that is generic, not the type itself.

By on 1/16/2011 1:16 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