Skip to content

Commit 2ee1328

Browse files
committed
Merge pull request scala#3496 from adriaanm/t6169
SI-6169 TODO: consolidate with fix for SI-1786 (scala#2518)
2 parents 16ed9f4 + bf06e15 commit 2ee1328

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/compiler/scala/tools/nsc/typechecker/Typers.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4902,6 +4902,9 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
49024902
)
49034903
arg match {
49044904
case Bind(_, _) => enhanceBounds()
4905+
// TODO: consolidate fixes for SI-6169 and SI-1786 by dropping the Ident case,
4906+
// in favor of doing sharpenQuantifierBounds for all ExistentialTypes, not just java-defined ones
4907+
// (need to figure out how to sharpen the bounds on creation without running into cycles)
49054908
case Ident(name) if canEnhanceIdent => enhanceBounds()
49064909
case _ =>
49074910
}

src/reflect/scala/reflect/internal/Types.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,6 +2693,8 @@ trait Types
26932693
*
26942694
* (Also tried doing this once during class file parsing or when creating the existential type,
26952695
* but that causes cyclic errors because it happens too early.)
2696+
*
2697+
* TODO: figure out how to do this earlier without running into cycles, so this can subsume the fix for SI-1786
26962698
*/
26972699
private def sharpenQuantifierBounds(): Unit = {
26982700
/* Check that we're looking at rawToExistential's handiwork

0 commit comments

Comments
 (0)