read JEP 360 PermittedSubclasses_attribute#9228
Conversation
| final val JAVA_DEFAULTMETHOD = 1L << 47 // symbol is a java default method | ||
| final val JAVA_ENUM = 1L << 48 // symbol is a java enum | ||
| final val JAVA_ANNOTATION = 1L << 49 // symbol is a java annotation | ||
| final val JAVA_SEALED = 1L << 50 // symbol is a java sealed |
There was a problem hiding this comment.
duplicate? 🤔
| pending += ParentSealedInheritanceError(tpt, psym) | ||
|
|
||
| if (psym.isJavaSealed) { | ||
| // TODO Don't report error if this is a permitted subclass |
| final val JAVA_DEFAULTMETHOD = 1L << 47 // symbol is a java default method | ||
| final val JAVA_ENUM = 1L << 48 // symbol is a java enum | ||
| final val JAVA_ANNOTATION = 1L << 49 // symbol is a java annotation | ||
| final val JAVA_SEALED = 1L << 50 // symbol is a java sealed |
There was a problem hiding this comment.
Is there any difference in behavior between Java sealed and Scala sealed? If not, can we reuse the existing Sealed flag instead of adding another one?
There was a problem hiding this comment.
+1 to reusing SEALED. If there is some logic that only applies to Scala sealed, we can implement this with sym.isSealed && !sym.isJava.
|
We can test without needed a hard dependency on JDK15 by building using ASM to write out the same classes that javac 15 would write. See |
|
@xuwei-k interested in continuing work on this...? |
|
This needs a lot more work, and it is something that we ultimately want supported in our Java parser. But we'll close this PR for now, for inactivity. We can reopen if interest returns, or someone can resubmit change. |
(partially?) fix 12171 🤔
scala/bug#12171
How to add tests? 🤔
I have tested manually