Community
Participate
Working Groups
In a very complex setting of multiple projects and teams with many role classes I see an error in the editor, when I try to do something like the following: Class c = SeperateRole<@t>.class; In the editor, an error is shown: "The method _OT$getClass$SeperateRole() is undefined for the type SomeTeam". However, this error does not appear in the problem view nor is it a problem while compiling. SeperateRole is any role of SomeTeam, which is definied in a seperate role file within the team package. If I do the same for a role class which is inlined in the enclosing team, the error message does not appear. Unfortunately (or not?), I was not able to reproduce the error in a simpler setting.
Could you please try what happens if you add a corresponding @role tag to the javadoc of the team containing SeperateRole? @role SeperateRole This should help the compiler to find the role file, and is recommended in order to prevent all kinds of issues wrt role files. Still a test case would be great so we could actually fix the issue, if possible.
Adding the @role tag does not change the behaviour. At the moment I don't see how I could extract a test case.
Closing as WORKSFORME since I can't reproduce. Feel free to reopen, when you see it again. Perhaps you could share the whole project so I can see the bug?
Using the original projects I can now reproduce. In reconciler mode the compiler takes a shortcut when processing a type that is not in the CU being reconciled. For the case of role files, however, we need to perform some more steps even in reconciler mode.
Created attachment 202709 [details] test & fix Here's a minimal unit test and a simple fix. The change in TypeDeclaration actually handles a follow-up NPE that resulted when continuing to process a type with partial method bodies.
Patch has been released for 2.1 M2 (r1998/99)
Verified (using 2.2 M5) that the change in class Dependencies indeed toggles the bug, and that this is correctly detected by OTReconcilerTests.