Skip to content

Commit 483bf2c

Browse files
authored
Merge pull request #13879 from dotty-staging/fix-13873
Indicate name of classfile where leaky mapping of existential type happens
2 parents 83effc3 + 1903676 commit 483bf2c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
739739
val anyTypes = boundSyms map (_ => defn.AnyType)
740740
val boundBounds = boundSyms map (_.info.bounds.hi)
741741
val tp2 = tp1.subst(boundSyms, boundBounds).subst(boundSyms, anyTypes)
742-
report.warning(FailureToEliminateExistential(tp, tp1, tp2, boundSyms))
742+
report.warning(FailureToEliminateExistential(tp, tp1, tp2, boundSyms, classRoot.symbol))
743743
tp2
744744
}
745745
else tp1

compiler/src/dotty/tools/dotc/reporting/messages.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1772,13 +1772,13 @@ import transform.SymUtils._
17721772
def explain = ""
17731773
}
17741774

1775-
class FailureToEliminateExistential(tp: Type, tp1: Type, tp2: Type, boundSyms: List[Symbol])(using Context)
1775+
class FailureToEliminateExistential(tp: Type, tp1: Type, tp2: Type, boundSyms: List[Symbol], classRoot: Symbol)(using Context)
17761776
extends Message(FailureToEliminateExistentialID) {
17771777
def kind: String = "Compatibility"
17781778
def msg =
17791779
val originalType = ctx.printer.dclsText(boundSyms, "; ").show
1780-
em"""An existential type that came from a Scala-2 classfile cannot be
1781-
|mapped accurately to to a Scala-3 equivalent.
1780+
em"""An existential type that came from a Scala-2 classfile for $classRoot
1781+
|cannot be mapped accurately to a Scala-3 equivalent.
17821782
|original type : $tp forSome ${originalType}
17831783
|reduces to : $tp1
17841784
|type used instead: $tp2

0 commit comments

Comments
 (0)