Recent

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

PascalDragon

  • Hero Member
  • *****
  • Posts: 505
  • 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: 431
  • Keep it simple.
    • Ditrianum
Re: declaring operator inc crashed the compiler
« Reply #17 on: April 10, 2019, 06:18:51 pm »
Lazarus 2.0.2; Manjaro Linux; Windows 10 x64;

Thaddy

  • Hero Member
  • *****
  • Posts: 8453
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 »
Read the manuals and if you are a professional get a proper education in computer science. Makes the forum a lot cleaner.