[fpc-pascal] Constants in generics tests

Ryan Joseph ryan at thealchemistguild.com
Fri Feb 15 20:11:36 CET 2019


Good catch, I have no idea what broke or how that could have happened.

I got it distilled down to this:

type
  generic TTest<const U> = class
    class procedure DoThis;	// <—— Forward declaration not solved "class DoThis;"
  end;

class procedure TTest.DoThis;
begin
end;

type
	ATest = specialize TTest<100>;

Something with class functions in particular. Very strange it can’t find the declaration. So never mind about submitting, I need to fix this now. :)


Also I just noticed that I’m getting warnings from the “U” constant which is declared in the “strict private” section (Private const "TTest$1.U" never used). That needs to be fixed also. Sven or some other compiler guy, do you know how to silence that warning?

> On Feb 15, 2019, at 1:52 PM, Jeppe Johansen <jeppe at j-software.dk> wrote:
> 
> Hi,
> 
> Do you know why this doesn't work?

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list