Recent

Author Topic: Internal error 2021052602  (Read 1243 times)

Fibonacci

  • Hero Member
  • *****
  • Posts: 649
  • Internal Error Hunter
Internal error 2021052602
« on: December 25, 2024, 07:20:20 pm »
Finally. Took a while.

Code: Pascal  [Select][+][-]
  1. program ie2021052602;
  2.  
  3. {$modeswitch ANONYMOUSFUNCTIONS}
  4.  
  5. //{$modeswitch CLASSICPROCVARS} // with this its a regular error: expected procedure, got pointer
  6. //{$modeswitch POINTERTOPROCVAR} // with this (and CLASSICPROCVARS) the code works fine
  7.  
  8. procedure test(p: TProcedure);
  9. begin
  10.   p;
  11. end;
  12.  
  13. begin
  14.   test(@(procedure // Error: Internal error 2021052602
  15.   begin
  16.     writeln('Hello');
  17.   end));
  18. end.

bytebites

  • Hero Member
  • *****
  • Posts: 698
Re: Internal error 2021052602
« Reply #1 on: December 25, 2024, 07:52:02 pm »
Working version without @

Code: Pascal  [Select][+][-]
  1. program ie2021052602;
  2. {$mode objfpc}
  3. {$modeswitch ANONYMOUSFUNCTIONS}
  4.  
  5. {$modeswitch CLASSICPROCVARS} // with this its a regular error: expected procedure, got pointer
  6. {$modeswitch POINTERTOPROCVAR} // with this (and CLASSICPROCVARS) the code works fine
  7.  
  8. procedure test(p: TProcedure);
  9. begin
  10.   p();
  11. end;
  12.  
  13. begin
  14.   test((procedure // Error: Internal error 2021052602
  15.   begin
  16.     writeln('Hello');
  17.   end));
  18. end.                        
  19.  

Fibonacci

  • Hero Member
  • *****
  • Posts: 649
  • Internal Error Hunter
Re: Internal error 2021052602
« Reply #2 on: December 25, 2024, 08:01:16 pm »
Working version without @

Absolutely! Thanks for the working version! :) But the goal is to find IEs, catch em all. A bit of a hobby ;D

 

TinyPortal © 2005-2018