Skip to content

Commit 52f4ee8

Browse files
committed
Homogenize Symbol methods in CompilerInterface
1 parent 873e44e commit 52f4ee8

File tree

3 files changed

+34
-30
lines changed

3 files changed

+34
-30
lines changed

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,12 +1516,14 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
15161516
def Symbol_isAbstractType(self: Symbol)(given Context): Boolean = self.isAbstractType
15171517
def Symbol_isClassConstructor(self: Symbol)(given Context): Boolean = self.isClassConstructor
15181518

1519-
def isPackageDefSymbol(symbol: Symbol)(given Context): Boolean =
1519+
def Symbol_isPackageDefSymbol(symbol: Symbol)(given Context): Boolean =
15201520
symbol.is(core.Flags.Package)
15211521

1522-
def isTypeSymbol(symbol: Symbol)(given Context): Boolean = symbol.isType
1522+
def Symbol_isTypeSymbol(symbol: Symbol)(given Context): Boolean =
1523+
symbol.isType
15231524

1524-
def isClassDefSymbol(symbol: Symbol)(given Context): Boolean = symbol.isClass
1525+
def Symbol_isClassDefSymbol(symbol: Symbol)(given Context): Boolean =
1526+
symbol.isClass
15251527

15261528
def Symbol_fields(self: Symbol)(given Context): List[Symbol] =
15271529
self.unforcedDecls.filter(isField)
@@ -1564,26 +1566,28 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
15641566

15651567
private def isField(sym: Symbol)(given Context): Boolean = sym.isTerm && !sym.is(Flags.Method)
15661568

1567-
def Symbol_of(fullName: String)(given ctx: Context): Symbol = ctx.requiredClass(fullName)
1569+
def Symbol_of(fullName: String)(given ctx: Context): Symbol =
1570+
ctx.requiredClass(fullName)
15681571

1569-
def isTypeDefSymbol(symbol: Symbol)(given Context): Boolean =
1572+
def Symbol_isTypeDefSymbol(symbol: Symbol)(given Context): Boolean =
15701573
symbol.isType && !symbol.is(core.Flags.Case)
15711574

15721575
def Symbol_isTypeParam(self: Symbol)(given Context): Boolean =
15731576
self.isTypeParam
15741577

1575-
def isTypeBindSymbol(symbol: Symbol)(given Context): Boolean =
1578+
def Symbol_isTypeBindSymbol(symbol: Symbol)(given Context): Boolean =
15761579
symbol.isType && symbol.is(core.Flags.Case)
15771580

1578-
def isTermSymbol(symbol: Symbol)(given Context): Boolean = symbol.isTerm
1581+
def Symbol_isTermSymbol(symbol: Symbol)(given Context): Boolean =
1582+
symbol.isTerm
15791583

1580-
def isDefDefSymbol(symbol: Symbol)(given Context): Boolean =
1584+
def Symbol_isDefDefSymbol(symbol: Symbol)(given Context): Boolean =
15811585
symbol.isTerm && symbol.is(core.Flags.Method)
15821586

15831587
def Symbol_signature(self: Symbol)(given Context): Signature =
15841588
self.signature
15851589

1586-
def isValDefSymbol(symbol: Symbol)(given Context): Boolean =
1590+
def Symbol_isValDefSymbol(symbol: Symbol)(given Context): Boolean =
15871591
symbol.isTerm && !symbol.is(core.Flags.Method) && !symbol.is(core.Flags.Case)
15881592

15891593
def Symbol_moduleClass(self: Symbol)(given Context): Symbol = self.moduleClass
@@ -1592,12 +1596,12 @@ class ReflectionCompilerInterface(val rootContext: core.Contexts.Context) extend
15921596

15931597
def Symbol_companionModule(self: Symbol)(given Context): Symbol = self.companionModule
15941598

1595-
def isBindSymbol(symbol: Symbol)(given Context): Boolean =
1599+
def Symbol_isBindSymbol(symbol: Symbol)(given Context): Boolean =
15961600
symbol.isTerm && symbol.is(core.Flags.Case)
15971601

15981602
def Symbol_noSymbol(given ctx: Context): Symbol = core.Symbols.NoSymbol
15991603

1600-
def isNoSymbol(symbol: Symbol)(given Context): Boolean = symbol eq core.Symbols.NoSymbol
1604+
def Symbol_isNoSymbol(symbol: Symbol)(given Context): Boolean = symbol eq core.Symbols.NoSymbol
16011605

16021606
//
16031607
// FLAGS

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,11 +1239,11 @@ trait CompilerInterface {
12391239

12401240
def Symbol_isDefinedInCurrentRun(self: Symbol)(given ctx: Context): Boolean
12411241

1242-
def isPackageDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
1242+
def Symbol_isPackageDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
12431243

1244-
def isTypeSymbol(symbol: Symbol)(given ctx: Context): Boolean
1244+
def Symbol_isTypeSymbol(symbol: Symbol)(given ctx: Context): Boolean
12451245

1246-
def isClassDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
1246+
def Symbol_isClassDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
12471247

12481248
/** Fields directly declared in the class */
12491249
def Symbol_fields(self: Symbol)(given ctx: Context): List[Symbol]
@@ -1268,20 +1268,20 @@ trait CompilerInterface {
12681268

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

1271-
def isTypeDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
1271+
def Symbol_isTypeDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
12721272

12731273
def Symbol_isTypeParam(self: Symbol)(given ctx: Context): Boolean
12741274

1275-
def isTypeBindSymbol(symbol: Symbol)(given ctx: Context): Boolean
1275+
def Symbol_isTypeBindSymbol(symbol: Symbol)(given ctx: Context): Boolean
12761276

1277-
def isTermSymbol(symbol: Symbol)(given ctx: Context): Boolean
1277+
def Symbol_isTermSymbol(symbol: Symbol)(given ctx: Context): Boolean
12781278

1279-
def isDefDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
1279+
def Symbol_isDefDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
12801280

12811281
/** Signature of this definition */
12821282
def Symbol_signature(self: Symbol)(given ctx: Context): Signature
12831283

1284-
def isValDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
1284+
def Symbol_isValDefSymbol(symbol: Symbol)(given ctx: Context): Boolean
12851285

12861286
/** The class symbol of the companion module class */
12871287
def Symbol_moduleClass(self: Symbol)(given ctx: Context): Symbol
@@ -1292,11 +1292,11 @@ trait CompilerInterface {
12921292
/** The symbol of the companion module */
12931293
def Symbol_companionModule(self: Symbol)(given ctx: Context): Symbol
12941294

1295-
def isBindSymbol(symbol: Symbol)(given ctx: Context): Boolean
1295+
def Symbol_isBindSymbol(symbol: Symbol)(given ctx: Context): Boolean
12961296

12971297
def Symbol_noSymbol(given ctx: Context): Symbol
12981298

1299-
def isNoSymbol(symbol: Symbol)(given ctx: Context): Boolean
1299+
def Symbol_isNoSymbol(symbol: Symbol)(given ctx: Context): Boolean
13001300

13011301
//
13021302
// FLAGS

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ trait SymbolOps extends Core {
9595
def isAbstractType(given ctx: Context): Boolean = internal.Symbol_isAbstractType(self)
9696
def isClassConstructor(given ctx: Context): Boolean = internal.Symbol_isClassConstructor(self)
9797

98-
def isType(given ctx: Context): Boolean = internal.isTypeSymbol(self)
99-
def isTerm(given ctx: Context): Boolean = internal.isTermSymbol(self)
100-
def isValDef(given ctx: Context): Boolean = internal.isValDefSymbol(self)
101-
def isDefDef(given ctx: Context): Boolean = internal.isDefDefSymbol(self)
102-
def isTypeDef(given ctx: Context): Boolean = internal.isTypeDefSymbol(self)
103-
def isClassDef(given ctx: Context): Boolean = internal.isClassDefSymbol(self)
104-
def isBind(given ctx: Context): Boolean = internal.isBindSymbol(self)
105-
def isPackageDef(given ctx: Context): Boolean = internal.isPackageDefSymbol(self)
106-
def isNoSymbol(given ctx: Context): Boolean = internal.isNoSymbol(self)
98+
def isType(given ctx: Context): Boolean = internal.Symbol_isTypeSymbol(self)
99+
def isTerm(given ctx: Context): Boolean = internal.Symbol_isTermSymbol(self)
100+
def isValDef(given ctx: Context): Boolean = internal.Symbol_isValDefSymbol(self)
101+
def isDefDef(given ctx: Context): Boolean = internal.Symbol_isDefDefSymbol(self)
102+
def isTypeDef(given ctx: Context): Boolean = internal.Symbol_isTypeDefSymbol(self)
103+
def isClassDef(given ctx: Context): Boolean = internal.Symbol_isClassDefSymbol(self)
104+
def isBind(given ctx: Context): Boolean = internal.Symbol_isBindSymbol(self)
105+
def isPackageDef(given ctx: Context): Boolean = internal.Symbol_isPackageDefSymbol(self)
106+
def isNoSymbol(given ctx: Context): Boolean = internal.Symbol_isNoSymbol(self)
107107

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

0 commit comments

Comments
 (0)