Skip to content

Commit ba9c2bf

Browse files
committed
Remove redundant method in CompilerInterface
1 parent 52f4ee8 commit ba9c2bf

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

compiler/src/dotty/tools/dotc/tastyreflect/ReflectionCompilerInterface.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,9 +1569,6 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
15691569
def Symbol_of(fullName: String)(given ctx: Context): Symbol =
15701570
ctx.requiredClass(fullName)
15711571

1572-
def Symbol_isTypeDefSymbol(symbol: Symbol)(given Context): Boolean =
1573-
symbol.isType && !symbol.is(core.Flags.Case)
1574-
15751572
def Symbol_isTypeParam(self: Symbol)(given Context): Boolean =
15761573
self.isTypeParam
15771574

@@ -1596,13 +1593,8 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
15961593

15971594
def Symbol_companionModule(self: Symbol)(given Context): Symbol = self.companionModule
15981595

1599-
def Symbol_isBindSymbol(symbol: Symbol)(given Context): Boolean =
1600-
symbol.isTerm && symbol.is(core.Flags.Case)
1601-
16021596
def Symbol_noSymbol(given ctx: Context): Symbol = core.Symbols.NoSymbol
16031597

1604-
def Symbol_isNoSymbol(symbol: Symbol)(given Context): Boolean = symbol eq core.Symbols.NoSymbol
1605-
16061598
//
16071599
// FLAGS
16081600
//

library/src/scala/tasty/reflect/CompilerInterface.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,8 +1268,6 @@ trait CompilerInterface {
12681268

12691269
def Symbol_of(fullName: String)(given ctx: Context): Symbol
12701270

1271-
def Symbol_isTypeDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
1272-
12731271
def Symbol_isTypeParam(self: Symbol)(given ctx: Context): Boolean
12741272

12751273
def Symbol_isTypeBindSymbol(symbol: Symbol)(given ctx: Context): Boolean
@@ -1292,12 +1290,8 @@ trait CompilerInterface {
12921290
/** The symbol of the companion module */
12931291
def Symbol_companionModule(self: Symbol)(given ctx: Context): Symbol
12941292

1295-
def Symbol_isBindSymbol(symbol: Symbol)(given ctx: Context): Boolean
1296-
12971293
def Symbol_noSymbol(given ctx: Context): Symbol
12981294

1299-
def Symbol_isNoSymbol(symbol: Symbol)(given ctx: Context): Boolean
1300-
13011295
//
13021296
// FLAGS
13031297
//

library/src/scala/tasty/reflect/SymbolOps.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package scala.tasty
22
package reflect
33

44
/** Tasty reflect symbol */
5-
trait SymbolOps extends Core {
6-
7-
// Symbol
5+
trait SymbolOps extends Core { selfSymbolOps: FlagsOps =>
86

97
object Symbol {
108
/** The class Symbol of a global class definition */
@@ -99,11 +97,12 @@ trait SymbolOps extends Core {
9997
def isTerm(given ctx: Context): Boolean = internal.Symbol_isTermSymbol(self)
10098
def isValDef(given ctx: Context): Boolean = internal.Symbol_isValDefSymbol(self)
10199
def isDefDef(given ctx: Context): Boolean = internal.Symbol_isDefDefSymbol(self)
102-
def isTypeDef(given ctx: Context): Boolean = internal.Symbol_isTypeDefSymbol(self)
100+
def isTypeDef(given ctx: Context): Boolean = self.isType && !self.flags.is(Flags.Case)
103101
def isClassDef(given ctx: Context): Boolean = internal.Symbol_isClassDefSymbol(self)
104-
def isBind(given ctx: Context): Boolean = internal.Symbol_isBindSymbol(self)
102+
def isBind(given ctx: Context): Boolean = self.isTerm && self.flags.is(Flags.Case)
103+
def isTypeBind(given ctx: Context): Boolean = self.isType && self.flags.is(Flags.Case)
105104
def isPackageDef(given ctx: Context): Boolean = internal.Symbol_isPackageDefSymbol(self)
106-
def isNoSymbol(given ctx: Context): Boolean = internal.Symbol_isNoSymbol(self)
105+
def isNoSymbol(given ctx: Context): Boolean = self == Symbol.noSymbol
107106

108107
/** Fields directly declared in the class */
109108
def fields(given ctx: Context): List[Symbol] =

0 commit comments

Comments
 (0)