Recent

Author Topic: Is this an issue? Generic method + {$M+}  (Read 498 times)

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 281
  • I use FPC [main] 💪🐯💪
Is this an issue? Generic method + {$M+}
« on: September 15, 2025, 10:19:14 am »
Code: Pascal  [Select][+][-]
  1. program app;
  2. {$ifdef FPC}{$mode delphi}{$endif}
  3.  
  4. type
  5.   {$M+}
  6.   TC = class
  7.   published
  8.     procedure test<T>;
  9.   end;
  10.   {$M-}
  11.  
  12. procedure TC.test<T>;
  13. begin
  14.   WriteLn('kek!');
  15. end;
  16.  
  17. begin
  18. end.

Output:
Code: [Select]
Error: Undefined symbol: P$APP$_$TC_$__$$_TEST$1 (first seen in app.o)
D12.1CE - OK (apparently, the D12.1CE compiler is generally poor at discarding unused methods (whether this is good or bad)
I may seem rude - please don't take it personally

Leledumbo

  • Hero Member
  • *****
  • Posts: 8831
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Is this an issue? Generic method + {$M+}
« Reply #1 on: September 16, 2025, 08:36:08 pm »
I'd say yes, report it. At least that shouldn't be a link time error, maybe a compile time error.

PascalDragon

  • Hero Member
  • *****
  • Posts: 6184
  • Compiler Developer
Re: Is this an issue? Generic method + {$M+}
« Reply #2 on: September 16, 2025, 10:28:13 pm »
Please report. :)

 

TinyPortal © 2005-2018