summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-02-11 19:24:43 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-02-11 19:24:43 -0800
commite3d624dd2760f2593949a1b5493f5a92fb02138a (patch)
treeb637aed3240e327fd613f22162766b4269f1b452 /src
parentadd9664c9f3a97ab3a4b7b3a4b9a3a578fca3d3d (diff)
parent48f6cdda26d23c563511caaf6842691b2cf5d23e (diff)
downloadscala-e3d624dd2760f2593949a1b5493f5a92fb02138a.tar.gz
scala-e3d624dd2760f2593949a1b5493f5a92fb02138a.tar.bz2
scala-e3d624dd2760f2593949a1b5493f5a92fb02138a.zip
Merge pull request #3509 from adriaanm/revert-t1786
Revert "SI-1786 incorporate defined bounds in inference"
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala22
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 _ =>
}
}
}