"class var" is broken for generics
Original Reporter info from Mantis: hnb
-
Reporter name: Maciej Izak
Original Reporter info from Mantis: hnb
- Reporter name: Maciej Izak
Description:
"class var" for generics type (record/class) is broken.
Attached example should print (like in equivalent in C# or for Delphi XE2 and newer):
42 21 84
Current output:
42 42 42
Very important point for whole generics system.
Related bug report with more comments: #24848 (closed)
Current implementation is broken, don't work even like buggy Delphi 2009-XE implementation.
Java implementation works as follow:
-single static variable for all specializations
-single static constructor for all specializations
C# implementation:
-static variable per specialization
-static constructor per specialization
Delphi buggy implementation (2009-XE):
-static variable is broken (unclear behavior)
-static constructor per specialization
Delphi correct implementation: (XE2 and newer):
-static variable per specialization
-static constructor per specialization
FPC:
-static variable instance per module and per specialization (?!)
-static constructor per specialization
Please adjust this behavior. We need to keep single standard/approach like in C#/Delphi (preferred) or like in Java.
Mantis conversion info:
- Mantis ID: 28911
- Build: 30739
- Version: 3.1.1
- Monitored by: » Hixie (Ian Hickson), » @martok (Martok), » Cyrax (Cyrax), » @sergy.larin (Sergey Larin)