Skip to content

3.0.0-RC2 Regression issue: type derivation of typed class not working well #12078

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
daenenk opened this issue Apr 13, 2021 · 3 comments
Closed
Assignees

Comments

@daenenk
Copy link

daenenk commented Apr 13, 2021

Compiler version

This issue popped up on scala "3.0.0-RC2" while I didn't saw it on 3.0.0-RC1

Minimized code

case class Box[A](a:A):
  def map[B](f: A => B): Box[B] = Box(f(a))

object T:
  box(1).map(_ + 1)

Output

[error] 41 |  box(1).map(_ + 1)
[error]    |             ^^^^^
[error]    |             Found:    Int => Int
[error]    |             Required: Boxed[Int]#A => Int

Expectation

Boxed[Int]#A should be recognized as being equivalent to Int in this case.

@daenenk
Copy link
Author

daenenk commented Apr 13, 2021

PS: while moving from 3.0.0-RC1 to 3.0.0-RC2 I also switched to sbt 1.5.0 i.s.o. using the dotty-plugin as recommended on https://www.scala-lang.org/blog/2021/04/08/scala-3-in-sbt.html

@bishabosha
Copy link
Member

bishabosha commented Apr 13, 2021

Thank you for opening the issue, please may you update your example so it does not produce missing reference errors, for example box does not exist, and if i change it to Box then the code compiles

5 |  box(1).map(_ + 1)
  |  ^^^
  |  Not found: box

@daenenk
Copy link
Author

daenenk commented Apr 13, 2021

Sorry, the minimized code is incomplete. And I had this on Scala 3.0.0-RC1 as well (I first though it was new). I posted the full issue already as a comment on #11729,
because I thought it may be strongly related.

@daenenk daenenk closed this as completed Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants