File tree 3 files changed +18
-12
lines changed
compiler/src/dotty/tools/dotc 3 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -263,6 +263,9 @@ object Contexts {
263
263
final def withPhaseNoEarlier (phase : Phase ) =
264
264
if (phase.exists && ctx.phase.id < phase.id) withPhase(phase) else ctx
265
265
266
+ // `creationTrace`-related code. To enable, uncomment the code below and the
267
+ // call to `setCreationTrace()` in this file.
268
+ /*
266
269
/** If -Ydebug is on, the top of the stack trace where this context
267
270
* was created, otherwise `null`.
268
271
*/
@@ -281,6 +284,7 @@ object Contexts {
281
284
}
282
285
println("=== end context creation trace ===")
283
286
}
287
+ */
284
288
285
289
/** The current reporter */
286
290
def reporter : Reporter = typerState.reporter
@@ -414,7 +418,8 @@ object Contexts {
414
418
this .implicitsCache = null
415
419
this .phasedCtx = this
416
420
this .phasedCtxs = null
417
- setCreationTrace()
421
+ // See comment related to `creationTrace` in this file
422
+ // setCreationTrace()
418
423
this
419
424
}
420
425
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