Hi!

Hi!
Anyone here with an "F2092 Program or unit '?' recursively uses itself" error in Tokyo?
I have this error in Tokyo but the same project compiles ok in Berlin.
Is this some issue with Tokyo only?
Can't find the problem in my project files.

Thanks.

Comments

  1. If you need circular unit references, you should take a long hard look at your class design. Circular references - even the "legal" type - is a code smell.

    Are there generics involved in your types?

    ReplyDelete
  2. Large circular reference cycles can trip the compiler into emitting this error (next to out-of-memory errors, access violations and internal errors and "unitX.pas F2063 Could not compile used unit 'unitY.pas'").
    Solution that usually works: quit Delphi, delete .DCU files, start Delphi, build all, then compile. Cumbersome, time consuming, but since the error is intermittent and involves large code bases, it's was hard to get it to R&D back in the days.

    ReplyDelete
  3. Primož Gabrijelčič Yes. Both using the IDE and dcc.

    ReplyDelete
  4. Lars Fosdal Jerônimo Neto I don't need and I don't have any. The project compiles fine in 10.1.
    The compiler doesn't say anything else besides the unit name in the error. It doesn't say any line number or filename where it finds the error.

    ReplyDelete
  5. It is possible that your search path is misconfigured. It is also possible that Tokyo introduced a unit with the same name as one of your units.

    You could try using a tool that shows you the unit usage tree. For example, Model Maker CodeExplorer knows how to do that, and there may be other tools for that.

    ReplyDelete
  6. Even this same unit compiles ok in Delphi 10.2 when used in another project. And this is what makes this error weirder.

    ReplyDelete
  7. Uninstalled Delphi 10.2 and did a clean install. Now the project compiles fine.
    Thank you all for your suggestions.

    ReplyDelete

Post a Comment