tags:

views:

71

answers:

2

I can't see anywhere that this should be the case, but I get an "Invalid declaration syntax" error in the get everytime I declare a static property that does not start with an uppercase letter. E.g:

type Foo() = class
    static member bar 
        with get() = "bar" //Invalid declaration syntax in get
end
+3  A: 

This is simply a bug in Beta2/October CTP. It only affects static properties that use the 'with get/set' syntax. You can use just the shorter syntax

static member bar = "bar"

as a workaround, assuming you only need a getter.

Brian
In fact, that's all I need so I used this solution :)
Bernadette
+2  A: 

To answer your question 'yes'. Property names should be capitalized as per the .NET coding guidelines. Unless you have a specific reason to have it be a lower case identifier, please have it be PascalCased.

http://msdn.microsoft.com/en-us/library/xzf533w0(VS.71).aspx

Chris Smith
Interesting, because I am transferring code from C# to F# and with the C# I don't have that problem.
Bernadette