Open cpyrgas opened 1 month ago
The fix for this will need to be tested also in conjunction with the /enforceself option. Not that in VO it is always mandatory to use SELF: for accessing methods and access/assigns. but not for class fields!!! In X# when enabling this option it requires SELF: everywhere, and I think we should keep it this way.
Also note that GLOBALs/DEFINEs should be resolved before properties (but still after class fields) even if they are defined in a separate library.
https://www.xsharp.eu/forum/topic?p=30408#p30408
Following should probably apply only to the VO dialect, and let other dialects handle this differently.
In VO, when there's a name ambiguity, the compiler resolves identifiers used inside a class in this order:
In X#, currently it resolves to ACCESS/ASSIGN before GLOBAL/DEFINE, causing unintended recursive calls
The following code compiles with no errors in VO, except for the two lines that are supposed to produce one. In X#, it's the opposite: