[fpc-pascal] Constants in generics tests

Ryan Joseph ryan at thealchemistguild.com
Fri Feb 15 17:22:46 CET 2019


Here’s the latest changes which fixed the constant type checking and includes some tests. Are the tests in the correct format? They are named tgenconst*.pp.

https://github.com/genericptr/freepascal/tree/generic_constants

For example:

{%FAIL}
{$mode objfpc}
program tgenconst8;
type
	generic TByte<const U: Byte> = record end;	
var
	a: specialize TByte<300>;
begin
end.


This will now give an error because 300 is a SmallInt. That’s everything I can think of for now. Please let me know if this is ready to submit yet.

Regards,
	Ryan Joseph




More information about the fpc-pascal mailing list