File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ class GadtConstraint private (
7777 sym.name.is(NameKinds .UniqueName ) && {
7878 val hi = sym.info.hiBound
7979 ! hi.isExactlyAny && self <:< hi
80+ // drop any lower param that is a GADT symbol
81+ // and is upper-bounded by a non-Any super-type of the original parameter
82+ // e.g. in pos/i14287.min
83+ // B$1 had info <: X and fullBounds >: B$2 <: X, and
84+ // B$2 had info <: B$1 and fullBounds <: B$1
85+ // We can use the info of B$2 to drop the lower-bound of B$1
86+ // and return non-bidirectional bounds B$1 <: X and B$2 <: B$1.
8087 }
8188 }.foldLeft(nonParamBounds(param).lo) {
8289 (t, u) => t | externalize(u)
@@ -88,7 +95,7 @@ class GadtConstraint private (
8895 val sym = paramSymbol(p)
8996 sym.name.is(NameKinds .UniqueName ) && {
9097 val lo = sym.info.loBound
91- ! lo.isExactlyNothing && lo <:< self
98+ ! lo.isExactlyNothing && lo <:< self // same as fullLowerBounds
9299 }
93100 }.foldLeft(nonParamBounds(param).hi) { (t, u) =>
94101 val eu = externalize(u)
Original file line number Diff line number Diff line change @@ -1743,7 +1743,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
17431743 else report.error(new DuplicateBind (b, cdef), b.srcPos)
17441744 if (! ctx.isAfterTyper) {
17451745 val bounds = ctx.gadt.fullBounds(sym)
1746- if (bounds != null ) sym.info = checkNonCyclic(sym, bounds, reportErrors = true )
1746+ if (bounds != null ) sym.info = bounds
17471747 }
17481748 b
17491749 case t : UnApply if t.symbol.is(Inline ) => Inlines .inlinedUnapply(t)
You can’t perform that action at this time.
0 commit comments