Constraints come at the end of the generic parameter list, so you want to do this:

1
type AVLmap<'key, 'value when 'key :> IComparable<'key>> = ...
By on 6/23/2010 6:18 AM ()

Constraints come at the end of the generic parameter list, so you want to do this:

1
type AVLmap<'key, 'value when 'key :> IComparable<'key>> = ...

Oh thanks. I should've thought to try that. I'm still a little confused about the syntax because AFAICS from the syntax for types on page 35 of the latest version of the language spec (2.0) my original is syntactically legal and the version you give is not (but works!). Is the spec correct re this I wonder?

type := long-ident<types> type when constraints(Though I guess that last one should in fact be..type when typar-constraints
)
types := type, ..., typeSo..types when (typar-)constraints.. is not legal syntax?

By on 6/23/2010 8:21 AM ()

The grammar definitions there are really confusing; what you actually want to look at is the typar-defns grammar element.

By on 6/23/2010 8:34 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