-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Sealed classes] Incorrect Reconciler error: The type A that implements a sealed interface I should be a permitted subtype of I #1998
Comments
I am also observing something "weird and seemingly stateful" happening with sealed interfaces/classes. If I add I upgraded Eclipse from 4.30 -> 4.31 but that didn't seem to help. Interestingly, if I clean + build the one project containing this modification:
This leads to needing a frequent "clean + rebuild all" workaround, which won't be scalable for my workspace. So I think this blocks me trying to adopt I would be happy to aid with testing any fixes on this big-ish workspace. (I can't promise how responsive I'll be, but I'll try.) |
I think what you are hitting is a problem in incremental builds/separate compilation. Thanks for the offer to test - I will propose a patch soon in the context of https://bugs.eclipse.org/bugs/show_bug.cgi?id=577872 - it would be great if you can test and report if that addresses your problem |
a sealed interface I should be a permitted subtype of I * Fixes eclipse-jdt#1998
tl:dr; I tested - looks good! What I did to test was run my usual Eclipse SDK 2024-06 (4.32) and upgraded just the JDT tools using this update site: https://download.eclipse.org/eclipse/updates/4.33-I-builds/I20240628-1800/ I no longer recollect which classes I was trying to convert to sealed-interfaces + records when I last hit this. However, I found some files known to be problematic (if I touched them at all in the editor, errors appear and the code cannot execute). These issues all look to be resolved in the new JDT, from what I can tell. (Now a small side-issue for me is that this JDT update did not get registered in the "installation history" so I cannot seem to revert it. Oh well, hopefully it doesn't cause trouble when upgrading to 4.33. Unfortunately from past experience, I think this does...) |
Thanks @lukeu very much! For the install issue I'll request @iloveeclipse to comment - it is out of my area. |
Ooh, I have found one regression with the nightly version of the JDT compiler, which seems limited to "sealed interface with nested records". There is a compiler error reported in the 2nd line of the
Running this with (I was updating a Scala-inspired |
Can you open a fresh ticket please ?? When you say a regression, did it work earlier with some version of eclipse ? If so could you cite the version please. I'll take a look soon. I am working on cleaning up the entire sealed types implementation in ECJ and defect reports are very welcome and timely now. |
Sure, see: #2667 |
Just to follow up & for posterity, I've solved this:
gory details: I had searched "JDT" in the "Install" dialog, but it matched something different, "Eclipse compiler for Java" at a top level (outside Eclipse Project SDK). This indeed caused conflicts updating - however it was in the revert dialog all along. With the new name worked out, I could unwind that and upgrade everything to 4.33-M1. |
…ts a sealed interface I should be a permitted subtype of I (eclipse-jdt#2601) * Fixes eclipse-jdt#1998 * Disable failing tests from thus far unhooked junit (See eclipse-jdt#2602)
…ts a sealed interface I should be a permitted subtype of I (eclipse-jdt#2601) * Fixes eclipse-jdt#1998 * Disable failing tests from thus far unhooked junit (See eclipse-jdt#2602)
Snippet:
On a save, problem marker vanishes. Edit the file, reappears.
The text was updated successfully, but these errors were encountered: