Intrinsic Default() in a generic procedure
Original Reporter info from Mantis: avk @avk959
-
Reporter name: avk
Original Reporter info from Mantis: avk @avk959
- Reporter name: avk
Description:
FPC seems to have problems using the Default() intrinsic in declarations of generic procedures/functions.
Specialization of the procedure with any non-simple type crashes the compiler.
The result of compiling the attached example:
Hint: (11030) Start of reading config file /home_dev/fpc/bin/x86_64-linux/fpc.cfg
Hint: (11031) End of reading config file /home_dev/fpc/bin/x86_64-linux/fpc.cfg
Free Pascal Compiler version 3.3.1-r45732 [2020/07/06] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling gen_default.pas
An unhandled exception occurred at $000000000056E794:
EAccessViolation: Access violation<br/>
$000000000056E794 GETDEFAULTVARSYM, line 456 of ninl.pas
$000000000058154D CREATE, line 2191 of htypechk.pas
$0000000000558101 PASS_TYPECHECK, line 3714 of ncal.pas
/home_dev/bugs/test_default/gen_default.pas(18,51) Error: (4119) It is not possible to define a default value for a parameter of type "TBla"
/home_dev/bugs/test_default/test_default.pas(18,51) Error: (1026) Compilation raised exception internally
Fatal: (1018) Compilation aborted
Error: /home_dev/fpc/bin/x86_64-linux/ppcx64 returned an error exitcode