Summary:
I have found that a class allows having duplicate definitions of the same public variable; as in name and type.
For example, the following was compiling successfully without any warnings or errors. I quickly tested, and you can also assign different default values as well; which would possibly be the source of a hard to find bug.
Reproduction Steps:
This was an existing class, but I am guessing you could simply add a new class, with similar code to the following.
I am using an existing project for me, so have not tried "reproducing" the error beyond my specific project and class.
Actual Behavior:
The project compiles successfully, without errors or warnings.
Expected Behavior:
I would expect the build to fail with an error that there is a duplicate definition.
I have found that a class allows having duplicate definitions of the same public variable; as in name and type.
For example, the following was compiling successfully without any warnings or errors. I quickly tested, and you can also assign different default values as well; which would possibly be the source of a hard to find bug.
Reproduction Steps:
This was an existing class, but I am guessing you could simply add a new class, with similar code to the following.
B4X:
Sub Class_Globals
Public Field1 as String
Public Field2 As String = "FIRST DEFINITION"
Public Field2 As String = "DUPLICATE"
Public Field3 As String
End Sub
I am using an existing project for me, so have not tried "reproducing" the error beyond my specific project and class.
Actual Behavior:
The project compiles successfully, without errors or warnings.
Expected Behavior:
I would expect the build to fail with an error that there is a duplicate definition.