[fpc-devel] RandomFrom vs Generics

Gabor Boros mlnglsts at bgss.hu
Tue Jun 5 16:25:46 CEST 2018


Hi All,

This

var
   x:Integer;
   a:array of Integer;

begin
   x:=RandomFrom(a);

code works with 3.0.4 but cannot compile with trunk and got "Error: 
Generics without specialization cannot be used as a type for a 
variable". Tried x:=specialize RandomFrom<Integer>(a); but got "Error: 
Identifier not found "RandomFrom"". How to call RandomFrom with trunk?

Gabor



More information about the fpc-devel mailing list