Closed
Description
Opened by: eiriktsarpalis
The definition
type Foo =
val foo : string
currently generates the following code (decompiled):
public class Foo
{
internal string foo@;
[CompilationMapping(SourceConstructFlags.Field, 0)]
public string foo
{
get
{
return this.foo@;
}
}
}
Is this correct behaviour? It does not seem to be recorded in the documentation (http://msdn.microsoft.com/en-us/library/dd469494.aspx) or the language spec.
I should note that this goes away as soon as I add the mutable keyword in the declaration. This might be intentional, since fields are always supposed to be mutable. But this feels wrong, particularly in the context of F# where the mutable keyword comes with a declaration of intention.
comments
dsyme wrote Today at 2:16 AM [x]
Yes, this is correct. We should make it clearer in the spec.
Metadata
Metadata
Assignees
Labels
No labels