class consts are always writeable, even in {$J-} / {$writeableconsts off} state.
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
class consts are always writeable, even in {J-} / {
writeableconsts off} state.
Also over unit boundaries.
Steps to reproduce:
{$mode objfpc}{$H+}{$J-}
type
TTestme=class
strict private
const
{$push}{$writeableconst off} // superfluous but also doesn't work
c_one:integer = 1;
c_two:integer = 10;
{$pop}
public
class property one:integer read c_one;
class property two:integer read c_two;
end;
begin
TTestme.c_one := 1000;
writeln(TTestme.One);
end.
Additional information:
If you separate the example class into a single unit, the results are the same.
Mantis conversion info:
- Mantis ID: 36114
- Build: 43087
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 43116 (#beb606be)