Skip to content

Commit 4241475

Browse files
committed
Tweak isReferencedSymbolically
The exception previously made for Scala2 innner classes causes the benchmark library project to fail with in the tree type map FullParameterization when called from LinkScala2Impl. It's not necessary to make the special case there because the Scalq2Unpickler will create anyway symbolic references to such inner classes.
1 parent b08b1a9 commit 4241475

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,7 @@ object Symbols {
448448

449449
final def isReferencedSymbolically(implicit ctx: Context) = {
450450
val d = lastDenot
451-
d != null && (
452-
(d is NonMember)
453-
|| d.isClass && d.is(Scala2x) && !d.owner.is(Package)
454-
|| d.isTerm && ctx.phase.symbolicRefs
455-
)
451+
d != null && (d.is(NonMember) || d.isTerm && ctx.phase.symbolicRefs)
456452
}
457453

458454
/** The symbol's signature if it is completed or a method, NotAMethod otherwise. */

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
734734
}
735735
val tycon =
736736
if (sym.isClass && sym.is(Scala2x) && !sym.owner.is(Package))
737-
// used fixed sym for Scala 2 inner classes, because they might be shadowed
737+
// use fixed sym for Scala 2 inner classes, because they might be shadowed
738738
TypeRef(pre, sym.asType)
739739
else if (isLocal(sym) || pre == NoPrefix) {
740740
val pre1 = if ((pre eq NoPrefix) && (sym is TypeParam)) sym.owner.thisType else pre

0 commit comments

Comments
 (0)