View Issue Details

IDProjectCategoryView StatusLast Update
0028989LazarusIDEpublic2020-07-30 09:32
ReporterJulian Puhl Assigned ToPascal Riekenberg  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version1.5 (SVN) 
Summary0028989: Code completion can not resolve generic types used in nested classes/objects/records
DescriptionExample:

type
  T3 = record
    Var1: Integer;
    Var2: Integer;
  end;

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

  TTest1 = specialize T1<T3>;

var
  testing: TTest1;
  testing2: TTest1.T2;

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

Relationships

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 

Activities

Julian Puhl

2015-11-11 16: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 10: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 11: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 16:29

developer   ~0122715

Is this still valid?

Pascal Riekenberg

2020-05-11 21:42

developer   ~0122718

Yes, it is.

Issue History

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