@@ -383,8 +383,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
383
383
* prefix. If the result has another unsafe instantiation, raise an error.
384
384
*/
385
385
private def healNonvariant [T <: Tree ](tree : T , pt : Type )(implicit ctx : Context ): T =
386
- if (ctx.unsafeNonvariant == ctx.runId && tree.tpe.widen.hasUnsafeNonvariant) {
387
- println(i " HEAL $tree" )
386
+ if (ctx.unsafeNonvariant == ctx.runId && tree.tpe.widen.hasUnsafeNonvariant)
388
387
tree match {
389
388
case tree @ Select (qual, _) if ! qual.tpe.isStable =>
390
389
val alt = typedSelect(tree, pt, Typed (qual, TypeTree (SkolemType (qual.tpe.widen))))
@@ -393,7 +392,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
393
392
case _ =>
394
393
ctx.error(ex " unsafe instantiation of type ${tree.tpe}" , tree.pos)
395
394
tree
396
- }}
395
+ }
397
396
else tree
398
397
399
398
def typedSelect (tree : untpd.Select , pt : Type )(implicit ctx : Context ): Tree = track(" typedSelect" ) {
@@ -2188,12 +2187,11 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
2188
2187
case _ =>
2189
2188
}
2190
2189
// try to fully instantiate type
2191
- {
2192
- val ictx = ctx.fresh.setNewTyperState
2193
- val constraint = ictx.typerState.constraint
2194
- if (isFullyDefined(wtp, force = ForceDegree .all)(ictx) &&
2195
- ictx.typerState.constraint.ne(constraint)) {
2196
- ictx.typerState.commit()
2190
+ { val localCtx = ctx.fresh.setNewTyperState
2191
+ val prevConstraint = localCtx.typerState.constraint
2192
+ if (isFullyDefined(wtp, force = ForceDegree .all)(localCtx) &&
2193
+ localCtx.typerState.constraint.ne(prevConstraint)) {
2194
+ localCtx.typerState.commit()
2197
2195
return adapt(tree, pt, original)
2198
2196
}
2199
2197
}
0 commit comments