File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,6 @@ trait TypeOps { this: Context => // TODO: Make standalone object.
7676 private def isLegalPrefix (pre : Type )(implicit ctx : Context ) =
7777 pre.isStable || ! ctx.phase.isTyper
7878
79- /** Approximate a type `tp` with a type that does not contain skolem types. */
80- object deskolemize extends ApproximatingTypeMap {
81- def apply (tp : Type ) = /* ctx.traceIndented(i"deskolemize($tp) at $variance", show = true)*/ {
82- tp match {
83- case tp : SkolemType => range(tp.bottomType, atVariance(1 )(apply(tp.info)))
84- case _ => mapOver(tp)
85- }
86- }
87- }
88-
8979 /** Implementation of Types#simplified */
9080 final def simplify (tp : Type , theMap : SimplifyMap ): Type = tp match {
9181 case tp : NamedType =>
Original file line number Diff line number Diff line change @@ -1061,7 +1061,18 @@ class Namer { typer: Typer =>
10611061
10621062 val rhsCtx = ctx.addMode(Mode .InferringReturnType )
10631063 def rhsType = typedAheadExpr(mdef.rhs, inherited orElse rhsProto)(rhsCtx).tpe
1064- def cookedRhsType = ctx.deskolemize(dealiasIfUnit(widenRhs(rhsType)))
1064+
1065+ // Approximate a type `tp` with a type that does not contain skolem types.
1066+ val deskolemize = new ApproximatingTypeMap {
1067+ def apply (tp : Type ) = /* ctx.traceIndented(i"deskolemize($tp) at $variance", show = true)*/ {
1068+ tp match {
1069+ case tp : SkolemType => range(tp.bottomType, atVariance(1 )(apply(tp.info)))
1070+ case _ => mapOver(tp)
1071+ }
1072+ }
1073+ }
1074+
1075+ def cookedRhsType = deskolemize(dealiasIfUnit(widenRhs(rhsType)))
10651076 lazy val lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.pos)
10661077 // if (sym.name.toString == "y") println(i"rhs = $rhsType, cooked = $cookedRhsType")
10671078 if (inherited.exists)
You can’t perform that action at this time.
0 commit comments