Skip to content

Commit 1375bf4

Browse files
committed
Drop Modifiers.hasMod
Since all Mod values are now reflected in flags and privateWithin, there is no need anymore to test whether a Mod exists.
1 parent 9a69dbc commit 1375bf4

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

compiler/src/dotty/tools/dotc/ast/untpd.scala

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
195195
def hasFlags = flags != EmptyFlags
196196
def hasAnnotations = annotations.nonEmpty
197197
def hasPrivateWithin = privateWithin != tpnme.EMPTY
198-
def hasMod[T: ClassTag] = {
199-
val cls = implicitly[ClassTag[T]].runtimeClass
200-
mods.exists(mod => cls.isAssignableFrom(mod.getClass))
201-
}
202198

203-
private def isEnum = hasMod[Mod.Enum] || is(Enum, butNot = JavaDefined)
199+
private def isEnum = is(Enum, butNot = JavaDefined)
204200

205201
def isEnumCase = isEnum && is(Case)
206202
def isEnumClass = isEnum && !is(Case)

0 commit comments

Comments
 (0)