Skip to content

Commit 7c9f61d

Browse files
committed
Do not use UnusedCommon directly
1 parent e446da1 commit 7c9f61d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler/src/dotty/tools/dotc/core/Flags.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ object Flags {
361361
/** Labeled with `unused` modifier (unused value) */
362362
final val UnusedCommon = commonFlag(42, "unused")
363363
final val Unused = UnusedCommon.toTermFlags
364+
final val UnusedType = UnusedCommon.toTypeFlags
364365

365366
// Flags following this one are not pickled
366367

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class UnusedChecks extends MiniPhase {
2525
/* Tree transform */
2626

2727
override def transformTypeDef(tree: TypeDef)(implicit ctx: Context): tree.type = {
28-
if (tree.symbol.is(UnusedCommon))
28+
if (tree.symbol.is(UnusedType))
2929
ctx.error(tree.symbol.showKind + " cannot be unused", tree.pos)
3030
tree
3131
}

0 commit comments

Comments
 (0)