Recent

Author Topic: declaring operator inc crashed the compiler  (Read 1649 times)

PascalDragon

  • Hero Member
  • *****
  • Posts: 674
  • Compiler Developer
Re: declaring operator inc crashed the compiler
« Reply #15 on: April 10, 2019, 09:18:56 am »
By the way, in Delphi Round and Trunc also operators.
:o

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: declaring operator inc crashed the compiler
« Reply #16 on: April 10, 2019, 02:54:55 pm »
By the way, in Delphi Round and Trunc also operators.
:o
Shell I open a bug report?  O:-)

Munair

  • Sr. Member
  • ****
  • Posts: 473
  • Try to KISS (keep it simple, smart)
    • Ditrianum
Re: declaring operator inc crashed the compiler
« Reply #17 on: April 10, 2019, 06:18:51 pm »
Lazarus 2.0.4; Manjaro, Debian, Windows

Thaddy

  • Hero Member
  • *****
  • Posts: 9188
Re: declaring operator inc crashed the compiler
« Reply #18 on: April 18, 2019, 07:44:45 am »
Sven has fixed the crash. Note that inc/dec are unary operators and take just one! parameter.
You can overload the procedures, though, if needed.
To sum up operator inc(var value:integer; increment:integer =1); is now forbidden.(and doesn't crash, but throws an error)
procedure inc/dec overloads are legal.

Michael has also  updated the documentation, as mentioned previously.
« Last Edit: April 18, 2019, 07:49:50 am by Thaddy »
also related to equus asinus.