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

Bounds of higher-kinded type member checked incorrectly #10186

Closed
scabug opened this issue Feb 13, 2017 · 3 comments · Fixed by scala/scala#9404
Closed

Bounds of higher-kinded type member checked incorrectly #10186

scabug opened this issue Feb 13, 2017 · 3 comments · Fixed by scala/scala#9404
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Feb 13, 2017

The following does not compile:

trait Foo {
  type A
  type F[_ <: A]
}

object Test {
  def noop[A, F[_ <: A]]: Unit = ()

  def f(foo: Foo): Unit = {
    noop[foo.A, foo.F] // does not compile
  }
}

The error is:

error: kinds of the type arguments (foo.A,foo.F) do not conform to the expected kinds of the type parameters (type A,type F).
foo.F's type parameters do not match type F's expected parameters:
type _ (in trait Foo)'s bounds <: Foo.this.A are stricter than type _'s declared bounds <: A
           noop[foo.A, foo.F] // does not compile
@scabug
Copy link
Author

scabug commented Feb 13, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10186?orig=1
Reporter: Tomas Mikula (tomas.mikula-at-gmail.com)
Affected Versions: 2.12.1
See #9337

@scabug
Copy link
Author

scabug commented Feb 13, 2017

@retronym said:
Merging with #9337, which I'll try to revive. The patch I linked in the comments of that ticket leads to successful bounds checking of your example above.

@scabug
Copy link
Author

scabug commented Feb 13, 2017

Tomas Mikula (tomas.mikula-at-gmail.com) said:
Thanks for the quick reply! Glad that there might be a patch already.

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

Successfully merging a pull request may close this issue.

3 participants