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

Slack LUBs fail to capture constraints between type parameters and blow up in RefChecks if used in a TypeTree #7694

Closed
scabug opened this issue Jul 25, 2013 · 2 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jul 25, 2013

trait A
trait B

trait L[A2, B2 <: A2]

object Lub {
  def lub = if (true) (null: L[A, A]) else (null: L[B, B])
  def foo(a: Any, b: Any) = (a, b)
  foo(b = lub, a = lub) // use named args transforms to include TypeTree(<lub.tpe>
}
<console>:13: error: type arguments [_1,_2] do not conform to trait L's type parameter bounds [A2,B2 <: A2]
         foo(b = lub, a = lub) // use named args transforms to include TypeTree(<lub.tpe>
                 ^

I suspect calculating the correct LUB will be to difficult, and we should instead disable the check for synthetic TypeTrees.

@scabug
Copy link
Author

@scabug scabug commented Jul 25, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7694?orig=1
Reporter: @retronym
Affected Versions: 2.10.0
Other Milestones: 2.11.0-M6

@scabug
Copy link
Author

@scabug scabug commented Jul 25, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants