Nested types, consts inside a class issues
Original Reporter info from Mantis: Fr0sT
-
Reporter name:
Original Reporter info from Mantis: Fr0sT
- Reporter name:
Description:
-
Please allow types, consts and vars inside a class for not-generic classes like Delphi does. It's very useful for defining some internal class things.
-
In generic classes, the "type public" constuction is allowed while on Delphi these two keywords are independent. So one has to write for Delphi and FPC separately:
{IFDEF FPC}type public{
ELSE}public type{$ENDIF}
{IFDEF FPC}var protected{
ELSE}protected var{$ENDIF}
P.S. Great thanks and respects for such a titanic work on FPC! It has almost all new Delphi features!
Steps to reproduce:
- In Delphi I can write as following:
TTimeParser = class
strict private
type
TTokenType = (ttSec, ttSecLZ, ttMin, ttMinLZ, ttHour, ttHourLZ, ttAMPM, ttTimeSep, ttSkipSpaces, ttSkipChar);
const
Tokens: array [TTokenType] of string =
('s', 'ss', 'n', 'nn', 'h', 'hh', 'aa', '::', ' ', '?');
...
In FPC I can't
Mantis conversion info:
- Mantis ID: 19388
- OS: XP
- OS Build: SP2
- Platform: Windows
- Version: 2.4.3