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 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 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 commented Jul 25, 2013

@retronym said:
scala/scala#2771

@scabug scabug closed this as completed Aug 13, 2013
@scabug scabug added this to the 2.10.3-RC1 milestone Apr 7, 2017
milessabin added a commit to milessabin/scala that referenced this issue Jan 12, 2018
+ Added uncheckedBounds to prevent issues similar to scala/bug#7694.
+ Inserted correct changeOwner
+ Assigned position correctly.
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