Skip to content

Commit

Permalink
dealias_normal moved to TypeView
Browse files Browse the repository at this point in the history
  • Loading branch information
tribbloid committed Nov 21, 2023
1 parent 808740e commit 6b73ae0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,20 +393,7 @@ trait SplainFormattingExtension extends typechecker.splain.SplainFormatting with
// new implementation is idempotent and won't lose information
override def dealias(tpe: Type): Type = {

if (isAux(tpe)) tpe
else {
val result = tpe.dealias.normalize
result match {
case p: PolyType =>
val target = dealias(p.resultType)
val _p = p.copy(
resultType = target
)
_p
case _ =>
result
}
}
TypeView(tpe).dealias_normal
}

case class FormattedIndex(
Expand Down
18 changes: 18 additions & 0 deletions core/src/main/scala-2.13.7+/latest/splain/TyperCompatViews.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ trait TyperCompatViews {
self
}

lazy val dealias_normal: Type = {

if (isAux(self)) self
else {
val result = self.dealias.normalize
result match {
case p: PolyType =>
val target = TypeView(p.resultType).dealias_normal
val _p = p.copy(
resultType = target
)
_p
case _ =>
result
}
}
}

lazy val definingSymbol: Symbol = {

self match {
Expand Down

0 comments on commit 6b73ae0

Please sign in to comment.