File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -850,8 +850,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
850850 nameString(sym.owner.name)
851851 else if (sym.is(ModuleClass ))
852852 nameString(sym.name.stripModuleClassSuffix)
853- else if (hasMeaninglessName(sym))
854- simpleNameString(sym.owner)
855853 else
856854 nameString(sym)
857855 (keywordText(kindString(sym)) ~~ {
Original file line number Diff line number Diff line change @@ -40,10 +40,11 @@ class CompleteJavaEnums extends MiniPhase with InfoTransformer { thisPhase =>
4040 addConstrParams(sym.info)
4141 else tp
4242
43- /** Is `sym` a Scala enum class that derives from `java.lang.Enum`?
43+ /** Is `sym` a Scala enum class that derives (directly) from `java.lang.Enum`?
4444 */
4545 private def derivesFromJavaEnum (sym : Symbol )(implicit ctx : Context ) =
46- sym.is(Enum , butNot = Case ) && sym.derivesFrom(defn.JavaEnumClass )
46+ sym.is(Enum , butNot = Case ) &&
47+ sym.info.parents.exists(p => p.typeSymbol == defn.JavaEnumClass )
4748
4849 /** Add constructor parameters `$name: String` and `$ordinal: Int` to the end of
4950 * the last parameter list of (method- or poly-) type `tp`.
You can’t perform that action at this time.
0 commit comments