Skip to content

Commit d8b7566

Browse files
committed
Polishings
1 parent 7c608c4 commit d8b7566

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

compiler/src/dotty/tools/dotc/config/Config.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ object Config {
148148
final val showCompletions = false
149149

150150
/** If set, enables tracing */
151-
final val tracingEnabled = true
151+
final val tracingEnabled = false
152152

153153
/** Initial capacity of uniques HashMap.
154154
* Note: This MUST BE a power of two to work with util.HashSet

compiler/src/dotty/tools/dotc/core/TyperState.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import printing.Texts._
1212
import config.Config
1313
import collection.mutable
1414
import java.lang.ref.WeakReference
15-
import Decorators._
1615

1716
class TyperState(previous: TyperState /* | Null */) extends DotClass with Showable {
1817

@@ -30,11 +29,11 @@ class TyperState(previous: TyperState /* | Null */) extends DotClass with Showab
3029

3130
def constraint = myConstraint
3231
def constraint_=(c: Constraint)(implicit ctx: Context) = {
33-
// println(i"assigning $c to $hashesStr")
3432
if (Config.debugCheckConstraintsClosed && isGlobalCommittable) c.checkClosed()
3533
myConstraint = c
3634
}
3735

36+
/** Reset constraint to `c` and mark current constraint as retracted if it differs from `c` */
3837
def resetConstraintTo(c: Constraint) = {
3938
if (c `ne` myConstraint) myConstraint.markRetracted()
4039
myConstraint = c

compiler/src/dotty/tools/dotc/typer/ProtoTypes.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,9 @@ object ProtoTypes {
195195

196196
override def notApplied = WildcardType
197197

198-
/** Forget the types of any arguments that have been typed producing a constraint that is
199-
* either
200-
* - in a typer state that is not yet committed into the one of the current context `ctx`, or
201-
* - has been retracted from its typestate because oif a failed operation.
198+
/** Forget the types of any arguments that have been typed producing a constraint
199+
* - that is in a typer state that is not yet committed into the one of the current context `ctx`,
200+
* - or that has been retracted from its typestate because oif a failed operation.
202201
* This is necessary to avoid "orphan" TypeParamRefs that are referred to from
203202
* type variables in the typed arguments, but that are not registered in the
204203
* current constraint. Test cases are pos/t1756.scala and pos/i3538.scala.
@@ -208,6 +207,7 @@ object ProtoTypes {
208207
evalState foreachBinding { (arg, tstateConstr) =>
209208
if ((tstateConstr._1.uncommittedAncestor.constraint `ne` ctx.typerState.constraint) ||
210209
tstateConstr._2.isRetracted) {
210+
typr.println(i"need to invalidate $arg / ${myTypedArg(arg)}, ${tstateConstr._2}, current = ${ctx.typerState.constraint}")
211211
myTypedArg = myTypedArg.remove(arg)
212212
evalState = evalState.remove(arg)
213213
}

0 commit comments

Comments
 (0)