Skip to content

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

Closed
@daenenk

Description

@daenenk

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions