Ambiguous overloaded functions might crash the compiler instead of printing an error, probably if there is no current_procinfo. :)
Forcibly overloading intrinsics this way might not be the wisest thing to do ([this issue](#37755) was closed with a “won’t do”), but there might be better examples... This code, as a part of a unit (as opposed to the main program; probably to ensure `current_procinfo = nil` :smile:), crashes the compiler at [`ncal.pas:3826`](https://gitlab.com/freepascal.org/fpc/source/-/blob/adf843196ae2599d75f627402f6c789c18f2b393/compiler/ncal.pas#L3826). ```pascal {$mode objfpc} unit SomeUnit; interface function Bsr(const value: byte): byte; internproc: fpc_in_bsr_x; function Bsr(const value: word): cardinal; internproc: fpc_in_bsr_x; function Bsr(const value: dword): cardinal; internproc: fpc_in_bsr_x; {$ifdef cpu64} function Bsr(const value: qword): cardinal; internproc: fpc_in_bsr_x; {$endif} type SomeEnum = (A, B, C, D); const SomeEnumBits = 1 + Bsr(ord(High(SomeEnum)) or 1); implementation end. ```
issue