diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-11 11:31:01 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-11 13:34:02 -0800 |
commit | 48f6cdda26d23c563511caaf6842691b2cf5d23e (patch) | |
tree | 99ff558db3fc26957d935ebf1296c093e4bda213 /src | |
parent | 64ad11b49bd7630d596e950953a5b15d3abf1689 (diff) | |
download | scala-48f6cdda26d23c563511caaf6842691b2cf5d23e.tar.gz scala-48f6cdda26d23c563511caaf6842691b2cf5d23e.tar.bz2 scala-48f6cdda26d23c563511caaf6842691b2cf5d23e.zip |
Revert "SI-1786 incorporate defined bounds in inference"
Have to revert because the stricter bounds that it inferred break e.g., slick.
(Backstop for that added as pos/t1786-counter.scala, as minimized by Jason)
Worse, the fix was compilation order-dependent.
There's a less invasive fix (SI-6169) that could be generalized
in `sharpenQuantifierBounds` (used in `skolemizeExistential`),
but I'd rather not mess with existentials at this point.
This reverts commit e28c3edda4dd405ed382227d2a688b799bf33c72.
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Typers.scala
test/files/pos/t1786.scala
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 088aa5216a..1a53fef4aa 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -4891,23 +4891,13 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper asym setInfo logResult(s"Updating bounds of ${asym.fullLocationString} in $tree from '$abounds' to")(TypeBounds(lo, hi)) } if (asym != null && asym.isAbstractType) { - // See pos/t1786 to follow what's happening here. - def canEnhanceIdent = ( - asym.hasCompleteInfo - && tparam.exists /* sometimes it is NoSymbol */ - && tparam.hasCompleteInfo /* SI-2940 */ - && !tparam.isFBounded /* SI-2251 */ - && !tparam.isHigherOrderTypeParameter - && !(abounds.hi <:< tbounds.hi) - && asym.isSynthetic /* this limits us to placeholder tparams, excluding named ones */ - ) arg match { - case Bind(_, _) => enhanceBounds() - // TODO: consolidate fixes for SI-6169 and SI-1786 by dropping the Ident case, - // in favor of doing sharpenQuantifierBounds for all ExistentialTypes, not just java-defined ones - // (need to figure out how to sharpen the bounds on creation without running into cycles) - case Ident(name) if canEnhanceIdent => enhanceBounds() - case _ => + // I removed the Ident() case that partially fixed SI-1786, + // because the stricter bounds being inferred broke e.g., slick + // worse, the fix was compilation order-dependent + // sharpenQuantifierBounds (used in skolemizeExistential) has an alternative fix (SI-6169) that's less invasive + case Bind(_, _) => enhanceBounds() + case _ => } } } |