Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • Lazarus Lazarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 2,102
    • Issues 2,102
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FPC
  • LazarusLazarus
  • LazarusLazarus
  • Issues
  • #23782
Closed
Open
Issue created Jan 29, 2013 by FPC Admin account@fpc_adminOwner

Autocomplete with generics

Original Reporter info from Mantis: Blaazen @Blaazen
  • Reporter name: Vojtech Cihak

Description:

Autocomplete does not work inside the "with begin end" block.

unit Unit1;            
{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, FGL;

type  
  { TForm1 }
  TForm1 = class(TForm)
    procedure FormClick(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;
  
  TGList = class(specialize TFPGObjectList<TButton>)   
    
  end;

var
  Form1: TForm1;
  GList: TGList;
  
implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.FormClick(Sender: TObject);
begin
  with GList[0] do
    begin
      
      Cancel:=True;
    end;   
end;

end.

The code is compilable.

Lazarus 1.1 r39980M FPC 2.7.1 x86_64-linux-qt

Steps to reproduce:

Start a new project (application)
CTRL+C and CTRL+V the code above.
Try CTRL+Space inside the "with begin .. end" block.

Messages says: unit1.pas(35,8) Error: expression type must be class or record type
but code is compilable with fpc 2.7.1

Mantis conversion info:

  • Mantis ID: 23782
  • OS: Linux
  • OS Build: 64-bit
  • Platform: amd64
  • Version: 1.1 (SVN)
  • Fixed in revision: r62470 (#29d750ae)
  • Monitored by: » jefferywa (jefferywa)
Assignee
Assign to
Time tracking