Skip to content

Commit cc453ce

Browse files
committed
adjust formatting, use isEnumClass
1 parent 8f21d24 commit cc453ce

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import scala.jdk.CollectionConverters._
1717
import collection.mutable
1818
import java.nio.file.Paths
1919

20+
import dotty.tools.dotc.transform.SymUtils._
21+
2022
import PartialFunction.condOpt
2123

2224
import 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)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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? */

0 commit comments

Comments
 (0)