Skip to content

Commit 4c800e2

Browse files
committed
Also print unique ids for symbols with meaningless names
1 parent 6d59b1c commit 4c800e2

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff 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)) ~~ {

compiler/src/dotty/tools/dotc/transform/CompleteJavaEnums.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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`.

0 commit comments

Comments
 (0)