Skip to content

Commit 9d373b3

Browse files
committed
Add debug output
1 parent 26576dc commit 9d373b3

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,13 @@ class CommunityBuildTest {
311311
|""".stripMargin)
312312
}
313313
}
314-
314+
/*
315315
@Test def intent = projects.intent.run()
316316
@Test def algebra = projects.algebra.run()
317+
*/
317318
@Test def scalacheck = projects.scalacheck.run()
318319
@Test def scalatest = projects.scalatest.run()
320+
/*
319321
@Test def scalatestplusScalacheck = projects.scalatestplusScalacheck.run()
320322
@Test def scalaXml = projects.scalaXml.run()
321323
@Test def scopt = projects.scopt.run()
@@ -334,7 +336,7 @@ class CommunityBuildTest {
334336
@Test def shapeless = projects.shapeless.run()
335337
@Test def xmlInterpolator = projects.xmlInterpolator.run()
336338
@Test def semanticdb = projects.semanticdb.run()
337-
@Test def effpi = projects.effpi.run()
339+
@Test def effpi = projects.effpi.run()*/
338340
}
339341

340342
class TestCategory

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ object Inferencing {
100100

101101
private var toMaximize: Boolean = false
102102

103-
def apply(x: Boolean, tp: Type): Boolean = tp.dealias match {
103+
private var rootType: Type = null
104+
105+
def apply(x: Boolean, tp: Type): Boolean =
106+
if rootType == null then rootType = tp
107+
tp.dealias match {
104108
case _: WildcardType | _: ProtoType =>
105109
false
106110
case tvar: TypeVar if !tvar.isInstantiated =>
@@ -112,9 +116,13 @@ object Inferencing {
112116
!force.allowBottom &&
113117
defn.isBottomType(ctx.typeComparer.approximation(tvar.origin, fromBelow = true))
114118
def preferMin = (force.minimizeAll || variance >= 0) && !avoidBottom
119+
def oldPreferMin = force.minimizeAll || variance >= 0 && !avoidBottom
115120
if (direction != 0) instantiate(tvar, direction < 0)
116121
else if (preferMin) instantiate(tvar, fromBelow = true)
117-
else toMaximize = true
122+
else
123+
if oldPreferMin then
124+
println(i"DIFFERENCE: maximizing $tvar with bounds ${ctx.typeComparer.bounds(tvar.origin)} in $rootType")
125+
toMaximize = true
118126
foldOver(x, tvar)
119127
}
120128
case tp =>

0 commit comments

Comments
 (0)