Skip to content

Commit 7951635

Browse files
committed
remove some unnecessary uses of .nn
1 parent 213491f commit 7951635

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ object OrderingConstraint {
7373
}
7474
else {
7575
val prev_es = entries(prev, poly)
76-
if (prev_es == null || (es.nn ne prev_es.nn))
76+
if (prev_es == null || (es.nn ne prev_es))
7777
current // can re-use existing entries array.
7878
else {
7979
es = es.nn.clone

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2581,7 +2581,7 @@ object SymDenotations {
25812581
try f.container == chosen.container catch case NonFatal(ex) => true
25822582
if !ambiguityWarningIssued then
25832583
for conflicting <- assocFiles.find(!sameContainer(_)) do
2584-
report.warning(em"""${ambiguousFilesMsg(conflicting.nn)}
2584+
report.warning(em"""${ambiguousFilesMsg(conflicting)}
25852585
|Keeping only the definition in $chosen""")
25862586
ambiguityWarningIssued = true
25872587
multi.filterWithPredicate(_.symbol.associatedFile == chosen)

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ object Formatting {
6363

6464
class ShowImplicits4:
6565
given [X: Show]: Show[X | Null] with
66-
def show(x: X | Null) = if x == null then "null" else CtxShow(toStr(x.nn))
66+
def show(x: X | Null) = if x == null then "null" else CtxShow(toStr(x))
6767

6868
class ShowImplicits3 extends ShowImplicits4:
6969
given Show[Product] = ShowAny

compiler/src/dotty/tools/dotc/transform/Erasure.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ object Erasure {
695695
val owner = sym.maybeOwner
696696
if defn.specialErasure.contains(owner) then
697697
assert(sym.isConstructor, s"${sym.showLocated}")
698-
defn.specialErasure(owner).nn
698+
defn.specialErasure(owner)
699699
else if defn.isSyntheticFunctionClass(owner) then
700700
defn.functionTypeErasure(owner).typeSymbol
701701
else

compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ object GenericSignatures {
262262
typeParamSig(sym.name.lastPart)
263263
}
264264
else if (defn.specialErasure.contains(sym))
265-
jsig(defn.specialErasure(sym).nn.typeRef)
265+
jsig(defn.specialErasure(sym).typeRef)
266266
else if (sym == defn.UnitClass || sym == defn.BoxedUnitModule)
267267
jsig(defn.BoxedUnitClass.typeRef)
268268
else if (sym == defn.NothingClass)

compiler/src/dotty/tools/dotc/transform/LazyVals.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,12 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
477477
newSymbol(claz, offsetName(info.defs.size), Synthetic, defn.LongType).enteredAfter(this)
478478
case None =>
479479
newSymbol(claz, offsetName(0), Synthetic, defn.LongType).enteredAfter(this)
480-
offsetSymbol.nn.addAnnotation(Annotation(defn.ScalaStaticAnnot, offsetSymbol.nn.span))
480+
offsetSymbol.addAnnotation(Annotation(defn.ScalaStaticAnnot, offsetSymbol.span))
481481
val fieldTree = thizClass.select(lazyNme.RLazyVals.getDeclaredField).appliedTo(Literal(Constant(containerName.mangledString)))
482-
val offsetTree = ValDef(offsetSymbol.nn, getOffset.appliedTo(fieldTree))
482+
val offsetTree = ValDef(offsetSymbol, getOffset.appliedTo(fieldTree))
483483
val offsetInfo = appendOffsetDefs.getOrElseUpdate(claz, new OffsetInfo(Nil))
484484
offsetInfo.defs = offsetTree :: offsetInfo.defs
485-
val offset = ref(offsetSymbol.nn)
485+
val offset = ref(offsetSymbol)
486486

487487
val swapOver =
488488
This(claz)
@@ -617,31 +617,31 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
617617
.symbol.asTerm
618618
else { // need to create a new flag
619619
offsetSymbol = newSymbol(claz, offsetById, Synthetic, defn.LongType).enteredAfter(this)
620-
offsetSymbol.nn.addAnnotation(Annotation(defn.ScalaStaticAnnot, offsetSymbol.nn.span))
620+
offsetSymbol.addAnnotation(Annotation(defn.ScalaStaticAnnot, offsetSymbol.span))
621621
val flagName = LazyBitMapName.fresh(id.toString.toTermName)
622622
val flagSymbol = newSymbol(claz, flagName, containerFlags, defn.LongType).enteredAfter(this)
623623
flag = ValDef(flagSymbol, Literal(Constant(0L)))
624624
val fieldTree = thizClass.select(lazyNme.RLazyVals.getDeclaredField).appliedTo(Literal(Constant(flagName.toString)))
625-
val offsetTree = ValDef(offsetSymbol.nn, getOffsetStatic.appliedTo(fieldTree))
625+
val offsetTree = ValDef(offsetSymbol, getOffsetStatic.appliedTo(fieldTree))
626626
info.defs = offsetTree :: info.defs
627627
}
628628

629629
case None =>
630630
offsetSymbol = newSymbol(claz, offsetName(0), Synthetic, defn.LongType).enteredAfter(this)
631-
offsetSymbol.nn.addAnnotation(Annotation(defn.ScalaStaticAnnot, offsetSymbol.nn.span))
631+
offsetSymbol.addAnnotation(Annotation(defn.ScalaStaticAnnot, offsetSymbol.span))
632632
val flagName = LazyBitMapName.fresh("0".toTermName)
633633
val flagSymbol = newSymbol(claz, flagName, containerFlags, defn.LongType).enteredAfter(this)
634634
flag = ValDef(flagSymbol, Literal(Constant(0L)))
635635
val fieldTree = thizClass.select(lazyNme.RLazyVals.getDeclaredField).appliedTo(Literal(Constant(flagName.toString)))
636-
val offsetTree = ValDef(offsetSymbol.nn, getOffsetStatic.appliedTo(fieldTree))
636+
val offsetTree = ValDef(offsetSymbol, getOffsetStatic.appliedTo(fieldTree))
637637
appendOffsetDefs += (claz -> new OffsetInfo(List(offsetTree), ord))
638638
}
639639

640640
val containerName = LazyLocalName.fresh(x.name.asTermName)
641641
val containerSymbol = newSymbol(claz, containerName, x.symbol.flags &~ containerFlagsMask | containerFlags, tpe, coord = x.symbol.coord).enteredAfter(this)
642642
val containerTree = ValDef(containerSymbol, defaultValue(tpe))
643643

644-
val offset = ref(offsetSymbol.nn)
644+
val offset = ref(offsetSymbol)
645645
val getFlag = Select(ref(defn.LazyValsModule), lazyNme.RLazyVals.get)
646646
val setFlag = Select(ref(defn.LazyValsModule), lazyNme.RLazyVals.setFlag)
647647
val wait = Select(ref(defn.LazyValsModule), lazyNme.RLazyVals.wait4Notification)

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,13 @@ object ProtoTypes {
466466
targ = typerFn(arg)
467467
// TODO: investigate why flow typing is not working on `targ`
468468
if ctx.reporter.hasUnreportedErrors then
469-
if hasInnerErrors(targ.nn, argType) then
469+
if hasInnerErrors(targ, argType) then
470470
state.errorArgs += arg
471471
else
472-
state.typedArg = state.typedArg.updated(arg, targ.nn)
472+
state.typedArg = state.typedArg.updated(arg, targ)
473473
state.errorArgs -= arg
474474
}
475-
targ.nn
475+
targ
476476
}
477477

478478
/** The typed arguments. This takes any arguments already typed using

0 commit comments

Comments
 (0)