XSharpPublic
XSharpPublic copied to clipboard
Add an option that enforces usage of self: also for fields and properties
Following code does not produce any compiler error about the missing SELF keywords:
#pragma options (enforceself, on)
CLASS TestClass
PROTECT n AS INT
EXPORT o AS OBJECT
CONSTRUCTOR()
? o == NULL
RETURN
METHOD Test() AS VOID
n := 1
? n
? TestProperty
RETURN
PROPERTY TestProperty AS INT GET n
END CLASS
Confirmed fixed
I have rolled back this changes in 2.21.0.1 because it generated way too much noise with the beta testers.
I think we should still implement this, one way or the other. Maybe by using another compiler option, or when using the /modernsyntax option or one of the others.
Will convert this into an enhancement request.