View Issue Details

IDProjectCategoryView StatusLast Update
0028989LazarusIDEpublic2021-06-11 07:56
ReporterJulian Puhl Assigned ToPascal Riekenberg  
Status assignedResolutionopen 
Product Version1.5 (SVN) 
Summary0028989: Code completion can not resolve generic types used in nested classes/objects/records

  T3 = record
    Var1: Integer;
    Var2: Integer;

  generic T1<T> = object
    type T2 = record
      TestVar2: T;
    TestVar1: T;

  TTest1 = specialize T1<T3>;

  testing: TTest1;
  testing2: TTest1.T2;

  testing.TestVar1.; //CTRL-Space shows Var1 and Var2
  testing2.TestVar2.; //CTRL-Space shows error: illegal qualifier . found
TagsNo tags attached.
Fixed in Revision
Attached Files


related to 0023903 closedMattias Gaertner Complete code error 
related to 0036981 closedMattias Gaertner Codetools: code completion for "FOR var IN" with generic class does not work 
related to 0038970 new Code navigation fails on generic nested types 


Julian Puhl

2015-11-11 15:12

reporter   ~0087235

I've done some debugging and it seems that it fails because GenParams.SpecializeParamsNode is nil when calling TFindDeclarationParams.FindGenericParamType. For TestVar1 this is not the case. I did not debug any further for now.

Julian Puhl

2017-04-25 08:48

reporter   ~0099906

It has been some time by now. For now we work around the bug with not using nested types plus casting variables to external types when necessary. Basically this means extra code so that the completion works.

How difficult is this problem to fix and do you plan to fix it at some point? Maybe you can point me in the right direction to what has to be done and I can try to fix it. I did try it once but got only mixed results plus the cache did break it often.

Mattias Gaertner

2017-04-25 09:18

manager   ~0099910

AFAIK Ondrej Pokorny implemented the current generics search in codetools.
You can ask him on the list or the forum.

Juha Manninen

2020-05-11 14:29

developer   ~0122715

Is this still valid?

Pascal Riekenberg

2020-05-11 19:42

developer   ~0122718

Yes, it is.

Issue History

Date Modified Username Field Change
2015-11-10 15:32 Julian Puhl New Issue
2015-11-10 16:05 Mattias Gaertner Assigned To => Mattias Gaertner
2015-11-10 16:05 Mattias Gaertner Status new => assigned
2015-11-11 15:12 Julian Puhl Note Added: 0087235
2015-12-10 14:14 Mattias Gaertner Relationship added related to 0023903
2017-04-25 08:48 Julian Puhl Note Added: 0099906
2017-04-25 09:18 Mattias Gaertner Note Added: 0099910
2020-05-11 14:28 Juha Manninen Relationship added related to 0036981
2020-05-11 14:29 Juha Manninen Note Added: 0122715
2020-05-11 19:42 Pascal Riekenberg Note Added: 0122718
2020-07-30 07:32 Pascal Riekenberg Assigned To Mattias Gaertner => Pascal Riekenberg
2021-06-11 07:56 Juha Manninen Relationship added related to 0038970