View Issue Details

IDProjectCategoryView StatusLast Update
0038367LazarusIDEpublic2021-01-17 23:43
ReporterMichl Assigned ToPascal Riekenberg  
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
Product Version2.1 (SVN) 
Summary0038367: Codetools can't create local variable for specialized list
DescriptionCodetools can't create local variable for specialized list:

procedure TFooList.DoBar;
begin
  for LFoo in Self do;
end;

In that code place cursor in front of LFoo and press Ctrl + Shift + C. I get the message "project1.lpr(23,15) Error: Term has no simple type"

I would expect autocompletion to:

procedure TFooList.DoBar;
var
  LFoo: Integer;
begin
  for LFoo in Self do;
end;
Steps To ReproduceCopy&Paste following code into a simple program and try:

program Project1;

{$mode objfpc}{$H+}

uses
  fgl;

type

  TFoo = Integer;

  { TFooList }

  TFooList = class(specialize TFPGList<TFoo>)
  public
    procedure DoBar;
  end;

{ TFooList }

procedure TFooList.DoBar;
begin
  for LFoo in Self do; // place cursor here in front of LFoo and press Ctrl + Shift + C
end;

begin
end.
TagsNo tags attached.
Fixed in Revision
LazTarget
Widgetset
Attached Files

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-01-17 23:43 Michl New Issue
2021-01-17 23:43 Michl Status new => assigned
2021-01-17 23:43 Michl Assigned To => Pascal Riekenberg