Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-04

generic, specialize keywords in mode delphi in FPC trunk

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

cobines

Hello.

Following program:

program a;
{$mode delphi}
type
  generic TGen<T> = class end;
  TSpc = specialize TGen<Integer>;
begin
end.

compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306:

a.pas(4,11) Fatal: Syntax error, "=" expected but "identifier TGEN" found
a.pas(5,21) Error: Identifier not found "specialize"
a.pas(5,21) Error: Error in type definition
a.pas(5,21) Fatal: Syntax error, ";" expected but "identifier TGEN" found

"generic" and "specialize" are not allowed in delphi mode in 2.5.1 but they are required in 2.4.2.

Is this a conscious change? There is no mention of this on Wiki User Changes 2.4.4 or User Changes Trunk pages.

cobines
Paul Ishenin
to cobines
cobines wrote 24 lines
Hello. Following program: program a; {$mode delphi} type generic TGen<T> = class end; TSpc = specialize TGen<Integer>; begin end. compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306: a.pas(4,11) Fatal: Syntax error, "=" expected but "identifier TGEN" found a.pas(5,21) Error: Identifier not found "specialize" a.pas(5,21) Error: Error in type definition a.pas(5,21) Fatal: Syntax error, ";" expected but "identifier TGEN" found "generic" and "specialize" are not allowed in delphi mode in 2.5.1 but they are required in 2.4.2. Is this a conscious change? There is no mention of this on Wiki User Changes 2.4.4 or User Changes Trunk pages.

In mode delphi FPC understands delphi generic syntax. I did not write a line to the

User Changes Trunk because this work is not finished. But looking at my free time I don't think it will be finished by me, so I will add a note there today.

Best regards,
Paul Ishenin

cobines
to Paul Ishenin: In mode delphi FPC understands delphi generic syntax. I did not write a line to the User…

2011/4/12 Paul Ishenin :

Show quoted text 33 lines
12.04.2011 4:22, cobines wrote: > > Hello. > > Following program: > > program a; > {$mode delphi} > type >   generic TGen<T>  = class end; >   TSpc = specialize TGen<Integer>; > begin > end. > > compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306: > > a.pas(4,11) Fatal: Syntax error, "=" expected but "identifier TGEN" found > a.pas(5,21) Error: Identifier not found "specialize" > a.pas(5,21) Error: Error in type definition > a.pas(5,21) Fatal: Syntax error, ";" expected but "identifier TGEN" found > > "generic" and "specialize" are not allowed in delphi mode in 2.5.1 but > they are required in 2.4.2. > > Is this a conscious change? There is no mention of this on Wiki User > Changes 2.4.4 or User Changes Trunk pages. In mode delphi FPC understands delphi generic syntax. I did not write a line to the User Changes Trunk because this work is not finished. But looking at my free time I don't think it will be finished by me, so I will add a note there today.

OK.
Thanks.

cobines
Sven Barth
to Paul Ishenin: In mode delphi FPC understands delphi generic syntax. I did not write a line to the User…
Paul Ishenin wrote 31 lines
12.04.2011 4:22, cobines wrote: > Hello. > > Following program: > > program a; > {$mode delphi} > type > generic TGen<T> = class end; > TSpc = specialize TGen<Integer>; > begin > end. > > compiles with FPC 2.4.2, but not with 2.5.1 rev. 17306: > > a.pas(4,11) Fatal: Syntax error, "=" expected but "identifier TGEN" found > a.pas(5,21) Error: Identifier not found "specialize" > a.pas(5,21) Error: Error in type definition > a.pas(5,21) Fatal: Syntax error, ";" expected but "identifier TGEN" found > > "generic" and "specialize" are not allowed in delphi mode in 2.5.1 but > they are required in 2.4.2. > > Is this a conscious change? There is no mention of this on Wiki User > Changes 2.4.4 or User Changes Trunk pages. In mode delphi FPC understands delphi generic syntax. I did not write a line to the User Changes Trunk because this work is not finished. But looking at my free time I don't think it will be finished by me, so I will add a note there today.

Would you mind if I'd try to continue/finish that work?

Regards,
Sven