Generic type pointer creation issu. lazarus / 62-General ---------------------------------------------------------------------- jamie · 2023-12-25 15:41 Why can't this be done Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Type Generic TMyGen = array of ^aType;// or just a type being derived as a Pointer of that type inline ? ---------------------------------------------------------------------- ASerge · 2023-12-25 20:13 I can suggest a workaround Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  generic TPointerArray = object  public    type PItemType = ^T;    type ArrayType = specialize TArray;  end; procedure TForm1.Button1Click(Sender: TObject);var  A: specialize TPointerArray.ArrayType;begin  SetLength(A, 1);  A[0] := @WriteErrorsToStdErr;  Caption := BoolToStr(A[0]^, True);end; ---------------------------------------------------------------------- jamie · 2023-12-25 20:19 Yeah, that's different for sure and it seems to work. I don't have a Delphi compiler in front of me at the moment that can test the original attempt, but shouldn't that work as my first attempt? ---------------------------------------------------------------------- PascalDragon · 2023-12-27 17:59 Quote from: jamie on December 25, 2023, 04:41:49 pmWhy can't this be done Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Type Generic TMyGen = array of ^aType;// or just a type being derived as a Pointer of that type inline ?  Considering that TSomeArr = array of ^SomeType does work, that is a bug. Please report with a small, complete, reproducible example. ---------------------------------------------------------------------- jamie · 2023-12-27 21:30 As much has I would love to post an example within code tags at the reporting site, the issue is that it does not like the <....>  in the post and when I preview it, it reports all kinds of errors in the text.  So you will have to take it from there I guess. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program Project1; {$mode objfpc}{$H+} uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Classes  { you can add units after this };Type  A = Array of ^Byte;  Generic TMyArrayPT = array of ^aType;//Error: Forward type not resolved "aType"  Generic TMTypePT = ^aType; //Error This type can not be a genericbeginend. ---------------------------------------------------------------------- AlexTP · 2023-12-28 07:07 Reported to https://gitlab.com/freepascal.org/fpc/source/-/issues/40575 Jamie, just use triple-ticks chars in the reporting site for blocks. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i ```pascal...some...code...```