Recent

Author Topic: Unnoticed syntax error?  (Read 734 times)

simone

  • Hero Member
  • *****
  • Posts: 573
Unnoticed syntax error?
« on: May 23, 2023, 09:55:01 pm »
Maybe I'm missing some syntactic nuance and I apologize if so... Why does the following code compile without errors?

Code: Pascal  [Select][+][-]
  1. program Project1;
  2. {$mode ObjFpc}
  3.  
  4. type
  5.   TEnum=(aaa,bbb,ccc);
  6.  
  7. function Fun:TEnum;
  8. begin
  9.   Result.:=aaa;  //Notice the dot!
  10. end;
  11.  
  12. begin
  13. end.
Microsoft Windows 10 64 bit - Lazarus 3.0 FPC 3.2.2 x86_64-win64-win32/win64

Bart

  • Hero Member
  • *****
  • Posts: 5288
    • Bart en Mariska's Webstek
Re: Unnoticed syntax error?
« Reply #1 on: May 23, 2023, 10:03:17 pm »
Nice catch.
Report on bugtracker (or first ask on fpc-devel mailinglist)?

Bart

PascalDragon

  • Hero Member
  • *****
  • Posts: 5462
  • Compiler Developer
Re: Unnoticed syntax error?
« Reply #2 on: May 23, 2023, 10:18:32 pm »
Report on bugtracker (or first ask on fpc-devel mailinglist)?

Report a bug, please.

Bart

  • Hero Member
  • *****
  • Posts: 5288
    • Bart en Mariska's Webstek
Re: Unnoticed syntax error?
« Reply #3 on: May 24, 2023, 05:08:56 pm »
« Last Edit: May 24, 2023, 05:23:25 pm by Bart »

 

TinyPortal © 2005-2018