... I can try to dismbiguate by qualifying the type name with the module name:
#light
module MyModule
type min =
static member x = 1
let y = MyModule.min.x

But this only works from outside the module. Inside the module it gives "The namespace or module 'MyModule' is not defined."

So, maybe my first stupid question is now this stupid question: How do I qualify a type reference defined inside the same module?

Thanks again, and sorry if this is FAQ,
- Jeff

By on 4/16/2009 1:43 PM ()

I don't have a direct answer to your question, but generally the naming convention for types is that they are PascalCased, so that would automatically disambiguate.

By on 4/16/2009 2:22 PM ()

You can't; this is currently a hole in the language, I am kind of surprised no one has encountered it before, but I don't recall anyone asking about this.

Your best bet is not to name the type 'min'.

By on 4/16/2009 2:22 PM ()

OK. At least I now know it's a hole in the language.

This really came up because I wanted a unit of measure for "minutes" and to define a static member to convert to seconds. Same problem. But I will rename my "minutes" unit of measure for now, or define it in its own module where I can disambiguate from the outside.

[<Measure>] type s
[<Measure>] type min =
static member per_s = 1.0 / 60.0<s/min> Thanks for the quick help, - Jeff

By on 4/16/2009 3:24 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