How To: PROPERTY INIT
Posted: Sat Aug 07, 2021 6:27 pm
Hi,
I read in the X# documentation in the "PROPERTY Statement" section about the possibility to specify an INIT accessor.
Quote from X# documentation:
The compiler throws an error:
Best regards,
Leonid
I read in the X# documentation in the "PROPERTY Statement" section about the possibility to specify an INIT accessor.
Quote from X# documentation:
Wrote the code:INIT accessor declare that a property can only be changed in the constructor of a class. A property cannot have both a SET and an INIT accessor.
Code: Select all
CLASS MyClass
PROPERTY MyProperty AS INT AUTO GET INIT
END CLASS
What is the correct use of the INIT keyword in a PROPERTY declaration?XS0518 Predefined type 'System.Runtime.CompilerServices.IsExternalInit' is not defined or imported
Best regards,
Leonid