Skip to content

Not actionable error about unaccurate Scala 2 existential type #14272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cchantep opened this issue Jan 14, 2022 · 3 comments
Closed

Not actionable error about unaccurate Scala 2 existential type #14272

cchantep opened this issue Jan 14, 2022 · 3 comments
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc good first issue Perfect for someone who wants to get started contributing itype:bug Spree Suitable for a future Spree

Comments

@cchantep
Copy link
Contributor

cchantep commented Jan 14, 2022

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.

@bishabosha
Copy link
Member

I added some minimised code

@bishabosha bishabosha added Spree Suitable for a future Spree good first issue Perfect for someone who wants to get started contributing area:reporting Error reporting including formatting, implicit suggestions, etc labels Jan 14, 2022
@ckipp01
Copy link
Member

ckipp01 commented Feb 25, 2022

I think this is a duplicate of #13873 and is already fixed by #13879

@smarter
Copy link
Member

smarter commented Feb 25, 2022

Indeed, fixed in 3.1.2-RC1.

@smarter smarter closed this as completed Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc good first issue Perfect for someone who wants to get started contributing itype:bug Spree Suitable for a future Spree
Projects
None yet
Development

No branches or pull requests

4 participants