Skip to content

Commit 875c94f

Browse files
committed
Avoid name clashes between Symbol and SymDenotation methods
1 parent 7753615 commit 875c94f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,27 @@ object Symbols {
9090
@targetName("invalidSymbol")
9191
def symbol(implicit ev: DontUseSymbolOnSymbol): Nothing
9292

93+
@targetName("Symbol_isTerm")
9394
def isTerm(using Context): Boolean
95+
96+
@targetName("Symbol_isType")
9497
def isType(using Context): Boolean
9598
def asTerm(using Context): TermSymbol
9699
def asType(using Context): TypeSymbol
100+
101+
@targetName("Symbol_isClass")
97102
def isClass: Boolean
103+
104+
@targetName("Symbol_asClass")
98105
def asClass: ClassSymbol
99106

100107
def isPrivate(using Context): Boolean
101108
def isPatternBound(using Context): Boolean
109+
110+
@targetName("Symbol_isStatic")
102111
def isStatic(using Context): Boolean
103112

113+
@targetName("Symbol_name")
104114
def name(using Context): ThisName
105115
def signature(using Context): Signature
106116

@@ -274,10 +284,14 @@ object Symbols {
274284
// periods check out OK. But once a package member is overridden it is not longer
275285
// valid. If the option would be removed, the check would be no longer needed.
276286

287+
@targetName("Symbol_isTerm")
277288
final def isTerm(using Context): Boolean =
278289
(if (defRunId == ctx.runId) lastDenot else denot).isTerm
290+
291+
@targetName("Symbol_isType")
279292
final def isType(using Context): Boolean =
280293
(if (defRunId == ctx.runId) lastDenot else denot).isType
294+
281295
final def asTerm(using Context): TermSymbol = {
282296
assert(isTerm, s"asTerm called on not-a-Term $this" );
283297
asInstanceOf[TermSymbol]
@@ -287,7 +301,10 @@ object Symbols {
287301
asInstanceOf[TypeSymbol]
288302
}
289303

304+
@targetName("Symbol_isClass")
290305
final def isClass: Boolean = isInstanceOf[ClassSymbol]
306+
307+
@targetName("Symbol_asClass")
291308
final def asClass: ClassSymbol = asInstanceOf[ClassSymbol]
292309

293310
/** Test whether symbol is private. This
@@ -312,6 +329,7 @@ object Symbols {
312329
Signature.NotAMethod
313330

314331
/** Special cased here, because it may be used on naked symbols in substituters */
332+
@targetName("Symbol_isStatic")
315333
final def isStatic(using Context): Boolean =
316334
lastDenot != null && lastDenot.initial.isStatic
317335

@@ -368,6 +386,7 @@ object Symbols {
368386
def filter(p: Symbol => Boolean): Symbol = if (p(this)) this else NoSymbol
369387

370388
/** The current name of this symbol */
389+
@targetName("Symbol_name")
371390
final def name(using Context): ThisName = denot.name.asInstanceOf[ThisName]
372391

373392
/** The source or class file from which this class or

0 commit comments

Comments
 (0)