View Issue Details

IDProjectCategoryView StatusLast Update
0030124LazarusIDEpublic2018-01-17 18:11
ReporterTED SMITH Assigned ToJuha Manninen  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
OSWindows 
Product Version1.6 
Summary0030124: specialize TFPGList<Int64> declaration is not supported by CodeTools
DescriptionI have a project built with Lazarus 1.4.4 and FPC 2.6.4. On that, all works fine.

The same project, when opened with Lazarus 1.6.0 and FPC 3.0 causes a problem. When I try to use the drop down properties of objects such as StringGrid.RequiredProperty, the properties do not appear and instead the messages windows reports the following :

myunit.pas(46,50) Error: expected ;, but TFPGList found

In the unit, I use the FGL unit in the uses section which is a unit for generics. One of the generics I use is a 64-bit list : TFPGList<Int64>. It is declared as follows :
[code]
type
  {64-bit TList declaration type, from the fgl unit }

  TListInt64 = specialize TFPGList<Int64>;

 TMyClass = class(TObject)
  private
  // none
  public
    ...
    function SaveOffsetsToFile(List : specialize TFPGList<Int64>; Filename : string) : boolean;
    ...
  end;
[/code]

Specifically, the messages window reports that the following is invalid :

(List : specialize TFPGList<Int64>; Filename : string)

In addition, when I type the name of functions like IntToHex, when I open the brackets, the system does not show the syntax help like it does usually. Again, whenever I open the brackets of any function, the same error is shown in the messages window.

Consequently, I can't use the 1.6 IDE of Lazarus and instead need to use v1.4.4 where everything works as normal with the same project.

I stress that a new project works fine, because I make no calls to specialize types nor use the FGL unit.

TagsNo tags attached.
Fixed in Revision
LazTarget-
Widgetset
Attached Files

Relationships

related to 0029785 resolvedMattias Gaertner Lazarus Code Completion breaks with Generics 
related to 0029163 resolvedMattias Gaertner Lazarus codecompletion stumbles on generics construct 
related to 0027847 resolvedJuha Manninen Packages CodeTools see generics as an error 
related to 0023782 resolvedJuha Manninen Lazarus Autocomplete with generics 
related to 0030349 assignedPascal Riekenberg Lazarus [codetools] Codetools doesn't recognize generic procedure inside a normal class, thus normal codetools functions will fail. 

Activities

TED SMITH

2016-05-12 17:18

reporter   ~0092538

Also see the thread that I opened here :

http://forum.lazarus.freepascal.org/index.php/topic,32561.0.html

Bart Broersma

2016-05-12 18:23

developer   ~0092539

Seems a problem with Lazarus CodeTools.
Can you build the program using fpc 3.0.0?

TED SMITH

2016-05-18 12:47

reporter   ~0092617

Sorry for the delay.

Yes...F9 will build and compile the program just fine. It simply impacts on my use of the IDE because functions don't show syntax help and object properties do not appear.

Zeljan Rikalo

2016-05-18 13:17

developer   ~0092618

This is codetools issue, not fpc one.

TED SMITH

2016-05-18 14:16

reporter   ~0092619

I didn't realise it was CodeTools related when I posted it. Is someone able to edit the "Project" assignment to CodeTools?.

TED SMITH

2016-11-26 14:09

reporter   ~0096246

Hi. Just installed Lazarus 1.6.2 and this particular problem still occurs.

Are there plans to fix it or do I need to remain on v1.4.4? Many thanks.

Juha Manninen

2016-11-26 19:14

developer   ~0096267

Last edited: 2016-11-26 23:19

View 3 revisions

As a workaround, why don't you use the type TListInt64 which you specialized?
It would be more logical and cleaner and CodeTools understands it.

Ondrej Pokorny

2016-11-27 17:32

developer   ~0096308

> Are there plans to fix it or do I need to remain on v1.4.4?

Did it really work in 1.4.4?

TED SMITH

2016-12-07 00:00

reporter   ~0096555

Juha

Your suggestion worked perfectly!! And it's actually easier to read that way, with just the one type declaration and from thereafter it is referred to just as TListInt64.

I feel rather stupid for not realising that sooner. You can close the ticket now. Thank you.

TED SMITH

2016-12-07 00:01

reporter   ~0096556

Ondrej

Yes, it did work fine with 1.4.4. Maybe it was never supposed to, but it did.

Juha Manninen

2016-12-08 20:50

developer   ~0096605

> Yes, it did work fine with 1.4.4. Maybe it was never supposed to, but it did.

That is false information. I tested the 1.4 fixes branch.
I also built over 3 years old trunk versions using FPC 2.6.4 as they don't compile with FPC 3.0.
CodeTools did not understand your code in any of those revisions.

TED SMITH

2016-12-09 12:39

reporter   ~0096618

> That is false information.

Well I don't want to argue about the matter - I was just trying to answer the question.

The syntax I used in the initial bug report was posted by someone else in the forum somewhere as a way of creating 64-bit integer lists about 2.5-3 years ago, and I followed it blindly. My programs worked and the Lazarus IDE worked as normal. As soon as I upgraded to 1.6, the problem arose, and all my projects were I used the same technique caused the same behaviour in v1.6 so I assumed (perhaps wrongly) that that was why.

Anyway, it's sorted now - your suggestion worked so we can just close it.

Juha Manninen

2016-12-09 14:40

developer   ~0096622

Last edited: 2016-12-09 14:48

View 2 revisions

> Anyway, it's sorted now - your suggestion worked so we can just close it.

No, this is a valid issue and should not be closed. The compiler accepts the code, thus CodeTools should understand it, too.
My suggestion was only a workaround.
The only question is about this being a regression or not. You say it is a regression, according to my tests it is not.
My plan was to bisect the quilty revision after I find a working one.
So I am not nitpicking, I am doing detective work for a possible regression.

Can you please test again that it worked in 1.4.4.
Can somebody else test and confirm it, please.

Ondrej Pokorny

2016-12-09 14:58

developer   ~0096624

> Can somebody else test and confirm it, please.

I tested Lazarus 1.4.2 and Codetools fail with that code.

AFAIK Codetools never fully supported this kind of syntax. It may be that at some point in the past they silently "ignored" it and as new features were added this syntax started to raise an error. Searching for a commit that broke this is useless.

Bart Broersma

2018-01-16 23:20

developer   ~0105873

Is this still an issue?
With Lazarus 1.9.0 r56712 FPC 3.0.4 i386-win32-win32/win64, I cannot reproducte the described error. Codetools seem to work just fine with this syntax.

Juha Manninen

2018-01-17 18:11

developer   ~0105887

Yes, this seems to be fixed.

Issue History

Date Modified Username Field Change
2016-05-12 17:16 TED SMITH New Issue
2016-05-12 17:18 TED SMITH Note Added: 0092538
2016-05-12 18:23 Bart Broersma Note Added: 0092539
2016-05-18 12:47 TED SMITH Note Added: 0092617
2016-05-18 13:17 Zeljan Rikalo Note Added: 0092618
2016-05-18 14:16 TED SMITH Note Added: 0092619
2016-05-18 19:47 Jonas Maebe Project FPC => Lazarus
2016-05-18 23:52 Maxim Ganetsky LazTarget => -
2016-05-18 23:52 Maxim Ganetsky Category FCL => IDE
2016-05-18 23:52 Maxim Ganetsky Product Version 3.0.0 =>
2016-05-18 23:53 Maxim Ganetsky Platform Lazarus 1.6 =>
2016-05-18 23:53 Maxim Ganetsky Product Version => 1.6
2016-05-18 23:59 Maxim Ganetsky Summary specialize TFPGList<Int64> declaration causing problem with FPC 3.0 => specialize TFPGList<Int64> declaration is not supported by CodeTools
2016-05-19 00:08 Juha Manninen Relationship added related to 0029785
2016-05-19 00:09 Juha Manninen Relationship added related to 0029163
2016-05-19 00:09 Juha Manninen Relationship added related to 0027847
2016-05-19 00:10 Juha Manninen Relationship added related to 0023782
2016-08-15 21:42 Ondrej Pokorny Relationship added related to 0030473
2016-08-16 07:49 Ondrej Pokorny Relationship deleted related to 0030473
2016-10-08 11:32 Juha Manninen Relationship added related to 0030349
2016-11-26 14:09 TED SMITH Note Added: 0096246
2016-11-26 19:14 Juha Manninen Note Added: 0096267
2016-11-26 19:16 Juha Manninen Note Edited: 0096267 View Revisions
2016-11-26 23:19 Juha Manninen Note Edited: 0096267 View Revisions
2016-11-27 17:32 Ondrej Pokorny Note Added: 0096308
2016-12-07 00:00 TED SMITH Note Added: 0096555
2016-12-07 00:01 TED SMITH Note Added: 0096556
2016-12-08 20:50 Juha Manninen Note Added: 0096605
2016-12-09 12:39 TED SMITH Note Added: 0096618
2016-12-09 14:40 Juha Manninen Note Added: 0096622
2016-12-09 14:48 Juha Manninen Note Edited: 0096622 View Revisions
2016-12-09 14:58 Ondrej Pokorny Note Added: 0096624
2018-01-16 23:20 Bart Broersma Note Added: 0105873
2018-01-16 23:20 Bart Broersma Status new => feedback
2018-01-17 18:11 Juha Manninen Note Added: 0105887
2018-01-17 18:11 Juha Manninen Status feedback => resolved
2018-01-17 18:11 Juha Manninen Resolution open => fixed
2018-01-17 18:11 Juha Manninen Assigned To => Juha Manninen