classes without constructors leave static strings as NULL
Submitted by pancake
Link to original bug (#589477)
Description
This simple class
class Foo { public static string foo = "boo"; }
generates something like this in C:
char *foo = NULL;
But the generated code is not pushing any constructor in there.
The compiler must do a workaround for this. The possibilities are:
- show an error complaining about the lack of constructor
- warn the user about the need to use 'const'
- fill the variable with a const string
The third option should be the expected one for the user, but programatically can be problematic because the string is stored in rodata instead of the heap and will have to track the correct use of it making this option harder.