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
3
3
import dotty .tools .dotc .core .Flags
4
4
import dotty .tools .dotc .core .Flags ._
5
5
6
- class FlagSet (flags : Flags .FlagSet ) extends scala.tasty.reflect.FlagSet {
6
+ class FlagSet (val flags : Flags .FlagSet ) extends scala.tasty.reflect.FlagSet {
7
7
8
8
def isProtected : Boolean = flags.is(Protected )
9
9
def isAbstract : Boolean = flags.is(Abstract )
Original file line number Diff line number Diff line change @@ -3,8 +3,16 @@ package tastyreflect
3
3
4
4
import dotty .tools .dotc .core .Decorators ._
5
5
6
+ import scala .tasty .reflect
7
+
6
8
trait FlagsOpsImpl extends scala.tasty.reflect.FlagsOps with CoreImpl {
7
9
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
+
8
16
object Flags extends FlagsModule {
9
17
def Protected : FlagSet = new FlagSet (core.Flags .Protected )
10
18
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
2
2
3
3
trait FlagsOps extends Core {
4
4
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
+
5
15
val Flags : FlagsModule
6
16
abstract class FlagsModule {
7
17
/** Is this symbol `protected` */
You can’t perform that action at this time.
0 commit comments