File tree 2 files changed +6
-5
lines changed
compiler/src/dotty/tools/dotc
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
292
292
private val nullType = ConstantType (Constant (null ))
293
293
private val nullSpace = Typ (nullType)
294
294
295
- override def intersectUnrelatedAtomicTypes (tp1 : Type , tp2 : Type ) = {
295
+ override def intersectUnrelatedAtomicTypes (tp1 : Type , tp2 : Type ): Space = {
296
296
val and = AndType (tp1, tp2)
297
297
// Precondition: !(tp1 <:< tp2) && !(tp2 <:< tp1)
298
298
// Then, no leaf of the and-type tree `and` is a subtype of `and`.
@@ -689,7 +689,8 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
689
689
tvar =>
690
690
! (ctx.typerState.constraint.entry(tvar.origin) `eq` tvar.origin.underlying) ||
691
691
(tvar `eq` removeThisType.prefixTVar),
692
- minimizeAll = false
692
+ minimizeAll = false ,
693
+ allowBottom = false
693
694
)
694
695
695
696
// If parent contains a reference to an abstract type, then we should
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ object Inferencing {
115
115
val minimize =
116
116
force.minimizeAll ||
117
117
variance >= 0 && ! (
118
- force == ForceDegree .noBottom &&
118
+ ! force.allowBottom &&
119
119
defn.isBottomType(ctx.typeComparer.approximation(tvar.origin, fromBelow = true )))
120
120
if (minimize) instantiate(tvar, fromBelow = true )
121
121
else toMaximize = true
@@ -466,9 +466,9 @@ trait Inferencing { this: Typer =>
466
466
467
467
/** An enumeration controlling the degree of forcing in "is-dully-defined" checks. */
468
468
@ sharable object ForceDegree {
469
- class Value (val appliesTo : TypeVar => Boolean , val minimizeAll : Boolean )
469
+ class Value (val appliesTo : TypeVar => Boolean , val minimizeAll : Boolean , val allowBottom : Boolean = true )
470
470
val none = new Value (_ => false , minimizeAll = false )
471
471
val all = new Value (_ => true , minimizeAll = false )
472
- val noBottom = new Value (_ => true , minimizeAll = false )
472
+ val noBottom = new Value (_ => true , minimizeAll = false , allowBottom = false )
473
473
}
474
474
You can’t perform that action at this time.
0 commit comments