Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#32 Can Set Initial Values for Fields In Structs

open-later
Core (12)
5
2009-08-21
2009-08-21
Phil Munie
No

It is possible to set initial values for fields in structs. This becomes a problem when you go to generate to C# code because it's a compiler error if you have instance field initializers.

For example:
<code>
public struct MyStruct
{
int myValue = 0; // Compiler error
}
</code>

Notes: Using NClass v2.01 in Windows.

Discussion

  • Balazs Tihanyi
    Balazs Tihanyi
    2009-08-21

    Thanks for pointing out this issue, I'll fix it later.

    Unfortunatey, there are still a lots of ways to create diagrams with incorrect semantics. I plan to change this and implement all kind of validation rules in the next major release.

     
  • Balazs Tihanyi
    Balazs Tihanyi
    2009-08-21

    • labels: 998057 --> Core
    • status: open --> open-later