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.
76
76
private def isLegalPrefix (pre : Type )(implicit ctx : Context ) =
77
77
pre.isStable || ! ctx.phase.isTyper
78
78
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
-
89
79
/** Implementation of Types#simplified */
90
80
final def simplify (tp : Type , theMap : SimplifyMap ): Type = tp match {
91
81
case tp : NamedType =>
Original file line number Diff line number Diff line change @@ -1061,7 +1061,18 @@ class Namer { typer: Typer =>
1061
1061
1062
1062
val rhsCtx = ctx.addMode(Mode .InferringReturnType )
1063
1063
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)))
1065
1076
lazy val lhsType = fullyDefinedType(cookedRhsType, " right-hand side" , mdef.pos)
1066
1077
// if (sym.name.toString == "y") println(i"rhs = $rhsType, cooked = $cookedRhsType")
1067
1078
if (inherited.exists)
You can’t perform that action at this time.
0 commit comments