Sign in Join

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

Mailing lists / lazarus / 2015-11

Codetools and specialize

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Leonardo M. Ramé

Hi, I'm trying to implement a method of an specialized class, but when I type ctrl+space the IDE shows "Error: Identifier not found: specialize". But I can compile this project without problems.

The definition of my class is this:

TActListStudies = class(specialize TBaseGAction<TDummy>)
public
   procedure Post; override;
end;

And the implementation:

procedure TActListStudies.Post;
begin
   // here CTRL+SPACE raises the error.
   Write('Your content here ...');
end;

Reply by email

Mattias Gaertner
to Leonardo M. Ramé
Show quoted text 10 lines
Hi, I'm trying to implement a method of an specialized class, but when I type ctrl+space the IDE shows "Error: Identifier not found: specialize". But I can compile this project without problems. The definition of my class is this: TActListStudies = class(specialize TBaseGAction<TDummy>) public procedure Post; override; end;

Codetools do not yet support anonymous specialization. See bug report:
http://bugs.freepascal.org/view.php?id=27895

Can you use below instead?

TBaseGActionDummy = specialize TBaseGAction<TDummy>;
TActListStudies = class(TBaseGActionDummy)
public
   procedure Post; override;
end;

Mattias

Reply by email

Leonardo M. Ramé
to Mattias Gaertner

El 16/11/15 a las 09:18, Mattias Gaertner escribi?:

Show quoted text 27 lines
On Mon, 16 Nov 2015 08:16:18 -0300 Leonardo M. Ram? wrote: > Hi, I'm trying to implement a method of an specialized class, but when I > type ctrl+space the IDE shows "Error: Identifier not found: specialize". > But I can compile this project without problems. > > The definition of my class is this: > > TActListStudies = class(specialize TBaseGAction<TDummy>) > public > procedure Post; override; > end; Codetools do not yet support anonymous specialization. See bug report: http://bugs.freepascal.org/view.php?id=27895 Can you use below instead? TBaseGActionDummy = specialize TBaseGAction<TDummy>; TActListStudies = class(TBaseGActionDummy) public procedure Post; override; end;

Hmm, when I change that, the same error is raised, this time in the definition of TBaseGAction:

generic TBaseGAction<T> = class(specialize TBrookGAction<T>)

...

Reply by email

Mattias Gaertner
to Leonardo M. Ramé
Show quoted text 35 lines
El 16/11/15 a las 09:18, Mattias Gaertner escribi?: > On Mon, 16 Nov 2015 08:16:18 -0300 > Leonardo M. Ram? wrote: > >> Hi, I'm trying to implement a method of an specialized class, but when I >> type ctrl+space the IDE shows "Error: Identifier not found: specialize". >> But I can compile this project without problems. >> >> The definition of my class is this: >> >> TActListStudies = class(specialize TBaseGAction<TDummy>) >> public >> procedure Post; override; >> end; > > Codetools do not yet support anonymous specialization. > See bug report: > http://bugs.freepascal.org/view.php?id=27895 > > Can you use below instead? > > TBaseGActionDummy = specialize TBaseGAction<TDummy>; > > TActListStudies = class(TBaseGActionDummy) > public > procedure Post; override; > end; > Hmm, when I change that, the same error is raised, this time in the definition of TBaseGAction: generic TBaseGAction<T> = class(specialize TBrookGAction<T>)

This needs anonymous specializations.

I improved Codetools a bit, so that the above case works better. The generic parameter T is still not handled correctly.

Mattias

Reply by email