Skip to content

Commit 7f81bc3

Browse files
committed
Make Unused flag a term flag only
1 parent ddf5b2c commit 7f81bc3

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
118118

119119
case class Implicit() extends Mod(Flags.ImplicitCommon)
120120

121-
case class Unused() extends Mod(Flags.UnusedCommon)
121+
case class Unused() extends Mod(Flags.Unused)
122122

123123
case class Final() extends Mod(Flags.Final)
124124

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,7 @@ object Flags {
368368
final val Enum = commonFlag(40, "<enum>")
369369

370370
/** Labeled with `unused` modifier (unused value) */
371-
final val UnusedCommon = commonFlag(42, "unused")
372-
final val Unused = UnusedCommon.toTermFlags
373-
final val UnusedType = UnusedCommon.toTypeFlags
371+
final val Unused = termFlag(42, "unused")
374372

375373
// Flags following this one are not pickled
376374

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ object Checking {
383383
fail(CannotHaveSameNameAs(sym, cls, CannotHaveSameNameAs.CannotBeOverridden))
384384
sym.setFlag(Private) // break the overriding relationship by making sym Private
385385
}
386-
checkApplicable(UnusedType, !sym.is(UnusedType))
387386
if (sym.is(Unused))
388387
checkApplicable(Unused, !sym.is(MutableOrLazy))
389388
}

0 commit comments

Comments
 (0)