I do use that object...

I do use that object...

procedure TClassInstanceDictionary.SendNotifyTelegram(const id: Integer; const tlg: TPSDTelegramBase);
var
  Obj : TBaseClass;
begin
  Obj := Items[Id] as TBaseClass; // <-- Hint
  Obj.SendNotifyTelegram(tlg);
end;

[dcc32 Hint] SomeUnit.pas(xxx): H2077 Value assigned to 'Obj' never used

Comments

  1. Nobody uses telegrams anymore, that so 1800's ;-)

    ReplyDelete
  2. When you have multiple concurrent client apps that massage the same data sets. and a server that mess with the massaged data - telegrams are a necessary evil - unless you want to go MQ or something - and - you don't.

    ReplyDelete
  3. Or just get rid of the dead variable:
    (Items[id] as TBaseClass).SendNotifyTelegram (tlg);

    ReplyDelete
  4. Willo van der Merwe - That's a bit trickey in XE4.

    procedure TClassInstanceDictionary.SendNotifyTelegram(const id: Integer; const tlg: TPSDTelegramBase);
    begin
       (Items[Id] as TBaseClass).SendNotifyTelegram(tlg);
    en|d;
         ^[dcc32 Fatal Error] SomeUnit.pas(xxx): F2084 Internal Error: C1769

    ReplyDelete
  5. Same for
       TBaseClass(Items[Id]).SendNotifyTelegram(tlg);

    ReplyDelete
  6. Oh dear. I thought the compiler might choke, but not like that!

    Hard cast it?

    ReplyDelete
  7. Lars Fosdal sounds to me like you uncovered a compiler bug.

    Can you recreate it in a new project, with a similar sample class?

    ReplyDelete
  8. I'll try - but there are several other massive generics classes in the unit, so it might not be possible to make a "mini version" of it.

    ReplyDelete
  9. not impressed with xe4, not impressed at all... hoping that xe5 will worth it...

    ReplyDelete
  10. There are a few nice small changes for the better - but yeah - it is still plagued with a lot of the old troubles with regards to the IDE, and not to forget - useless internal errors in the Generics compiler.

    ReplyDelete
  11. „There are a few nice small changes for the better¯
    you should get at least "something" for the upgrade... but based on your posts(thank you a lot for them), it seems that there's quite a bit of hassle to upgrade, many things need to be tested and fiddle with in order to keep my projects working...

    ReplyDelete
  12. No more hassles than expected, I'd say. It's on par with the previous updates.

    ReplyDelete
  13. ... not that it in any way should be seen as a measure of success.  They really need to improve the IDE.

    ReplyDelete
  14. Dorin Duminica The compiler went straight downhill regarding generics from XE3 on ... I just completly ticked out yesterday when I read the resolution comment on QC#116151...

    ReplyDelete

Post a Comment