no class variables in variant part of a record
Original Reporter info from Mantis: creaothceann
-
Reporter name:
Original Reporter info from Mantis: creaothceann
- Reporter name:
Description:
A record with a variant part that is specified as "class var" contains variables that are not class variables, but normal instance variables. The "class var" part seems to get ignored.
Steps to reproduce:
- create console program
- add {$MODESWITCH AdvancedRecords}
- create type t with a variant part containing variable v
- add "class var" before the "case"
- declare two variables a, b of type t
- change a.v to any non-zero value, then display b.v
Result: b.v is still unmodified, meaning that the variables in the variant part are not 'class' variables.
Additional information:
A record with class variables (in mode AdvancedRecords) shares all these variables with all instances. A record can also have a variant part:
type t : record
case int of
0: (x : word);
1: (y : byte);
end;
In this case, y occupies the same location as the first byte of x.
Mantis conversion info:
- Mantis ID: 31117
- OS: Windows
- OS Build: 10
- Build: 53354 (Lazarus)
- Platform: x86 x64
- Version: 3.0.0
- Fixed in version: 3.1.1
- Fixed in revision: 1383 (#9fcaca35)
- Monitored by: » @PascalDragon (Sven Barth), » creaothceann (creaothceann)
- Target version: 3.2.0