Forum > General

"Error: Illegal Expression" with generics

(1/2) > >>

deadserious:
I'm trying to get my cocinasync library to compile under freepascal trunk  (thanks to anonymous methods) and running into a problem instantiating a generic type.  Compile is failing on the following code in DELPHIUNICODE mode:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---class constructor TDefaultJob<T>.Create;begin  FPool := TStack<IJob<T>>.Create;end;  
The code compiles in Delphi just fine and can be found in the cocinasync.jobs unit.

BildatBoffin:
just to be sure, mode delphi toogled on ?

deadserious:
Yes, as stated in the original message it's in DELPHIUNICODE mode.

deadserious:
Incidentally, I can get around the error by declaring a type alias as such...


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  TJobStack<T> = class(TStack<IJob<T>>)    end; 

Thaddy:
And fpc trunk/main a.k.a. 3.3.1 or 3.2.2/3.2.3 ?
I need more code to reproduce.

Navigation

[0] Message Index

[#] Next page

Go to full version