Re: [fpc-devel] RandomFrom vs Generics
Gabor Boros schrieb am Mi., 6. Juni 2018, 10:15: > 2018. 06. 06. 9:05 keltezéssel, Sven Barth via fpc-devel írta: > > Seems like a bug due to there being multiple overloads plus the generic. > > Would you please report that to the bug tracker? > > > Done: > > https://bugs.freepascal.org/view.php?id=33829 Thanks! > > > Does it work if you add "overload;" to the generic's declaration in the > > Math unit? > > No. (After modified the math.pp and build the whole compiler from > scratch with make all zipinstall.) > It was worth a try. 路♀️ Thank you for testing. Regards, Sven > ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] RandomFrom vs Generics
2018. 06. 06. 9:05 keltezéssel, Sven Barth via fpc-devel írta: Seems like a bug due to there being multiple overloads plus the generic. Would you please report that to the bug tracker? Done: https://bugs.freepascal.org/view.php?id=33829 Does it work if you add "overload;" to the generic's declaration in the Math unit? No. (After modified the math.pp and build the whole compiler from scratch with make all zipinstall.) Gabor ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Re: [fpc-devel] RandomFrom vs Generics
Gabor Boros schrieb am Mi., 6. Juni 2018, 08:09: > 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(a); but got "Error: > Identifier not found "RandomFrom"". How to call RandomFrom with trunk? > Seems like a bug due to there being multiple overloads plus the generic. Would you please report that to the bug tracker? Does it work if you add "overload;" to the generic's declaration in the Math unit? Regards, Sven > ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
[fpc-devel] RandomFrom vs Generics
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(a); but got "Error: Identifier not found "RandomFrom"". How to call RandomFrom with trunk? Gabor ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel