File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
compiler/src/dotty/tools/dotc/tastyreflect
library/src/scala/tasty/reflect Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package dotty.tools.dotc.tastyreflect
33import dotty .tools .dotc .core .Flags
44import dotty .tools .dotc .core .Flags ._
55
6- class FlagSet (flags : Flags .FlagSet ) extends scala.tasty.reflect.FlagSet {
6+ class FlagSet (val flags : Flags .FlagSet ) extends scala.tasty.reflect.FlagSet {
77
88 def isProtected : Boolean = flags.is(Protected )
99 def isAbstract : Boolean = flags.is(Abstract )
Original file line number Diff line number Diff line change @@ -3,8 +3,16 @@ package tastyreflect
33
44import dotty .tools .dotc .core .Decorators ._
55
6+ import scala .tasty .reflect
7+
68trait FlagsOpsImpl extends scala.tasty.reflect.FlagsOps with CoreImpl {
79
10+ def FlagsDeco (flagSet : scala.tasty.reflect.FlagSet ): FlagsAPI = new FlagsAPI {
11+ def is (that : reflect.FlagSet ): Boolean = flagSet.asInstanceOf [FlagSet ].flags is that.asInstanceOf [FlagSet ].flags
12+ def | (that : reflect.FlagSet ): reflect.FlagSet = new FlagSet (flagSet.asInstanceOf [FlagSet ].flags | that.asInstanceOf [FlagSet ].flags)
13+ def & (that : reflect.FlagSet ): reflect.FlagSet = new FlagSet (flagSet.asInstanceOf [FlagSet ].flags & that.asInstanceOf [FlagSet ].flags)
14+ }
15+
816 object Flags extends FlagsModule {
917 def Protected : FlagSet = new FlagSet (core.Flags .Protected )
1018 def Abstract : FlagSet = new FlagSet (core.Flags .Abstract )
Original file line number Diff line number Diff line change @@ -2,6 +2,16 @@ package scala.tasty.reflect
22
33trait FlagsOps extends Core {
44
5+ trait FlagsAPI {
6+ /** Is the given flag set a subset of this flag sets */
7+ def is (flagSet : FlagSet ): Boolean
8+ /** Union of the two flag sets */
9+ def | (flagSet : FlagSet ): FlagSet
10+ /** Intersection of the two flag sets */
11+ def & (flagSet : FlagSet ): FlagSet
12+ }
13+ implicit def FlagsDeco (flagSet : FlagSet ): FlagsAPI
14+
515 val Flags : FlagsModule
616 abstract class FlagsModule {
717 /** Is this symbol `protected` */
You can’t perform that action at this time.
0 commit comments