mode fpc: syntax for generic function return value
Original Reporter info from Mantis: roked
-
Reporter name: Marģers
Original Reporter info from Mantis: roked
- Reporter name: Marģers
Description:
As known in mode fpc function return value has to be assigned to function name (not to "return" keyword).
example:
{$mode fpc}
function foo (a:byte):byte;
begin
foo:=a+a; //-- good
// return:=a+a; //-- bad (it should be so)
end;
Lets make this function generic - there is no way to return func value if not using mode switch to allow "return".
generic function foo <T>(a: T ):byte;
begin
// foo:=a+a; //-- does not work. Error: Generic without specialization cannot be used...
//specialize foo <byte> := a+a; //-- Error: identifier not found gn$1
// return:= a+a; //-- without proper mode switch - Error: Identifier not found "return"
end;
it's missing possibility for return value for generic function in mode fpc
Mantis conversion info:
- Mantis ID: 35798
- OS: linux
- OS Build: .
- Platform: x86_64
- Version: 3.3.1