Skip to content
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

Overload resolution fails to dealias abstract types #10194

Closed
scabug opened this issue Feb 16, 2017 · 2 comments
Closed

Overload resolution fails to dealias abstract types #10194

scabug opened this issue Feb 16, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Feb 16, 2017

Here's a minimized reproduction based on scala/collection-strawman#23:

trait X[A] {
  def map[B](f: A => B): Unit
}

trait Y[A] extends X[A] {
  def map[B](f: A => B)(implicit ordering: Ordering[B]): Unit
}

trait Z[A] extends Y[A]

class StrawmanTest {
  (null: Y[Int]).map(x => x.toString) // compiles
  (null: Z[Int]).map(x => x.toString) // doesn't compile
}

This seems to hit a corner case or bug in scala/scala#5307. In the second case functionProto in handleOverloaded computes a WildcardType because the abstract type A is not instantiated as expected by tp.asSeenFrom in funArgTypes. In the first case it gets instantiated as Int.

@scabug
Copy link
Author

scabug commented Feb 16, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10194?orig=1
Reporter: @szeiger
Affected Versions: 2.12.1

@scabug
Copy link
Author

scabug commented Feb 16, 2017

@szeiger said:
PR: scala/scala#5708

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants