Skip to content

Not actionable error about unaccurate Scala 2 existential type #14272

Closed
@cchantep

Description

@cchantep

Compiler version

3.1.0

Minimized code

// compile with 2.13.7
import language.existentials

abstract class Box[T]

object Box {
  def id(b: Box[Box[x]] forSome { type x }) = b
}
// compile with 3.1.0
@main def test =
  val b = Box.id(??? : Box[Box[Int]])

Output

An existential type that came from a Scala-2 classfile cannot be
mapped accurately to to a Scala-3 equivalent.
original type    : Box[Box[x]] forSome x
reduces to       : Box[Box[x]]
type used instead: Box[Box[Any]]
This choice can cause follow-on type errors or hide type errors.
Proceed at own risk.

longer explanation available when compiling with `-explain`
An existential type that came from a Scala-2 classfile cannot be
mapped accurately to to a Scala-3 equivalent.
original type    : Box[Box[x]] forSome x
reduces to       : Box[Box[x]]
type used instead: Box[Box[Any]]
This choice can cause follow-on type errors or hide type errors.
Proceed at own risk.

longer explanation available when compiling with `-explain`

Expectation

Mention which classfile is causing the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SpreeSuitable for a future Spreearea:reportingError reporting including formatting, implicit suggestions, etcgood first issuePerfect for someone who wants to get started contributingitype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions