Skip to content

Commit 076c96c

Browse files
committed
Convert remaining underlying -> superType
1 parent 608086f commit 076c96c

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,10 @@ object ExplicitOuter {
316316
else tpe.prefix
317317
case _ =>
318318
// Need to be careful to dealias before erasure, otherwise we lose prefixes.
319-
atPhaseNoLater(erasurePhase)(outerPrefix(tpe.underlying))
319+
atPhaseNoLater(erasurePhase)(outerPrefix(tpe.superType))
320320
}
321321
case tpe: TypeProxy =>
322-
outerPrefix(tpe.underlying)
322+
outerPrefix(tpe.superType)
323323
}
324324

325325
/** It's possible (i1755.scala gives an example) that the type

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ object TypeUtils {
104104
case self @ TypeRef(prefix, _) if self.symbol.isClass =>
105105
prefix.select(self.symbol.companionModule).asInstanceOf[TermRef]
106106
case self: TypeProxy =>
107-
self.underlying.mirrorCompanionRef
107+
self.superType.mirrorCompanionRef
108108
}
109109

110110
/** Is this type a methodic type that takes implicit parameters (both old and new) at some point? */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ trait Deriving {
3333
case tp: TypeRef if tp.symbol.isClass => tp
3434
case tp: TypeRef if tp.symbol.isAbstractType => NoType
3535
case tp: TermRef => NoType
36-
case tp: TypeProxy => underlyingClassRef(tp.underlying)
36+
case tp: TypeProxy => underlyingClassRef(tp.superType)
3737
case _ => NoType
3838
}
3939

@@ -286,7 +286,7 @@ trait Deriving {
286286
case tp @ TypeRef(prefix, _) if tp.symbol.isClass =>
287287
prefix.select(tp.symbol.companionModule).asInstanceOf[TermRef]
288288
case tp: TypeProxy =>
289-
companionRef(tp.underlying)
289+
companionRef(tp.superType)
290290
}
291291
val resultType = instantiated(sym.info)
292292
val companion = companionRef(resultType)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class ImplicitSearchError(
257257
++ ErrorReporting.matchReductionAddendum(pt)
258258
}
259259

260-
private def formatMsg(shortForm: String)(headline: String = shortForm) = arg match
260+
private def formatMsg(shortForm: String)(headline: String = shortForm) = arg match
261261
case arg: Trees.SearchFailureIdent[?] =>
262262
arg.tpe match
263263
case _: NoMatchingImplicits => headline
@@ -387,7 +387,7 @@ class ImplicitSearchError(
387387
.map(userDefinedImplicitNotFoundTypeMessage)
388388
.find(_.isDefined).flatten
389389
case tp: TypeProxy =>
390-
recur(tp.underlying)
390+
recur(tp.superType)
391391
case tp: AndType =>
392392
recur(tp.tp1).orElse(recur(tp.tp2))
393393
case _ =>

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,16 +549,16 @@ object Implicits:
549549
override def msg(using Context) = _msg
550550
def explanation(using Context) = msg.toString
551551

552-
/** A search failure type for failed synthesis of terms for special types */
552+
/** A search failure type for failed synthesis of terms for special types */
553553
class SynthesisFailure(reasons: List[String], val expectedType: Type) extends SearchFailureType:
554554
def argument = EmptyTree
555555

556-
private def formatReasons =
557-
if reasons.length > 1 then
558-
reasons.mkString("\n\t* ", "\n\t* ", "")
559-
else
556+
private def formatReasons =
557+
if reasons.length > 1 then
558+
reasons.mkString("\n\t* ", "\n\t* ", "")
559+
else
560560
reasons.mkString
561-
561+
562562
def explanation(using Context) = em"Failed to synthesize an instance of type ${clarify(expectedType)}: ${formatReasons}"
563563

564564
end Implicits
@@ -763,7 +763,7 @@ trait ImplicitRunInfo:
763763
WildcardType
764764
else
765765
seen += t
766-
t.underlying match
766+
t.superType match
767767
case TypeBounds(lo, hi) =>
768768
if lo.isBottomTypeAfterErasure then apply(hi)
769769
else AndType.make(apply(lo), apply(hi))
@@ -871,7 +871,7 @@ trait Implicits:
871871
SearchFailure(new SynthesisFailure(errors, formal), span).tree
872872
else
873873
tree.orElse(failed)
874-
874+
875875

876876
/** Search an implicit argument and report error if not found */
877877
def implicitArgTree(formal: Type, span: Span)(using Context): Tree = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ class Synthesizer(typer: Typer)(using @constructorOnly c: Context):
365365
// avoid type aliases for tuples
366366
Right(MirrorSource.GenericTuple(types))
367367
case _ => reduce(tp.underlying)
368-
case _ => reduce(tp.underlying)
368+
case _ => reduce(tp.superType)
369369
case tp @ AndType(l, r) =>
370370
for
371371
lsrc <- reduce(l)

0 commit comments

Comments
 (0)