operators inc/dec crashes the compiler when a default value is given for the amount.
Original Reporter info from Mantis: Thaddy
-
Reporter name: Thaddy de Koning
Original Reporter info from Mantis: Thaddy
- Reporter name: Thaddy de Koning
Description:
The operators inc/dec generate a compiler crash when the amount parameter has a default value.
Steps to reproduce:
// example taken from engkin's entry on the forum
{$mode objfpc}{$H+}
Type
TAZ=String;
operator inc(az: TAZ; i: integer=1) raz:TAZ; // inline;
begin
end;
begin
end.
Additional information:
Same example also crashes with dec.
It does not crash when no default value is given.
It maybe simply that the default value should not be allowed, but the compiler should not crash.
I wonder if these operators should not be dropped: the procedure overloads are fine.
Mantis conversion info:
- Mantis ID: 35348
- OS: all
- OS Build: all
- Build: 41848
- Platform: all
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 41869 (#e6add404)