File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
compiler/src/dotty/tools/dotc
library/src-bootstrapped/scala/reflect Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ import scala.jdk.CollectionConverters._
1717import collection .mutable
1818import java .nio .file .Paths
1919
20+ import dotty .tools .dotc .transform .SymUtils ._
21+
2022import PartialFunction .condOpt
2123
2224import ast .untpd .{given _ }
@@ -191,7 +193,7 @@ class ExtractSemanticDB extends Phase:
191193 val selfSpan = tree.self.span
192194 if selfSpan.exists && selfSpan.hasLength then
193195 traverse(tree.self)
194- if tree.symbol.owner.is( Enum , butNot = Case ) then
196+ if tree.symbol.owner.isEnumClass then
195197 tree.body.foreachUntilImport(traverse).foreach(traverse) // the first import statement
196198 else
197199 tree.body.foreach(traverse)
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ object SymUtils {
171171 self
172172 }
173173
174- def isEnum (using Context ): Boolean = self.is(Enum , butNot= JavaDefined )
174+ def isEnum (using Context ): Boolean = self.is(Enum , butNot = JavaDefined )
175175 def isEnumClass (using Context ): Boolean = isEnum && ! self.is(Case )
176176
177177 /** Does this symbol refer to anonymous classes synthesized by enum desugaring? */
Original file line number Diff line number Diff line change 11package scala .reflect
22
3- /** A base trait of all enum classes */
3+ /** A base trait of all Scala enum definitions */
44super trait Enum extends Any , Product , Serializable :
55
66 /** A string uniquely identifying a case of an enum */
You can’t perform that action at this time.
0 commit comments