Skip to content

Commit 5c74218

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 66727e3 commit 5c74218

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
@@ -197,12 +197,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
197197
def hasFlags = flags != EmptyFlags
198198
def hasAnnotations = annotations.nonEmpty
199199
def hasPrivateWithin = privateWithin != tpnme.EMPTY
200-
def hasMod[T: ClassTag] = {
201-
val cls = implicitly[ClassTag[T]].runtimeClass
202-
mods.exists(mod => cls.isAssignableFrom(mod.getClass))
203-
}
204200

205-
private def isEnum = hasMod[Mod.Enum] || is(Enum, butNot = JavaDefined)
201+
private def isEnum = is(Enum, butNot = JavaDefined)
206202

207203
def isEnumCase = isEnum && is(Case)
208204
def isEnumClass = isEnum && !is(Case)

0 commit comments

Comments
 (0)