Recent

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

simone

  • Hero Member
  • *****
  • Posts: 543
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 2.2.4

Bart

  • Hero Member
  • *****
  • Posts: 5132
    • 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: 5273
  • 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: 5132
    • 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