Skip to content

HK type parameterY not considered a subtype of [T] => Y[T] in some situations #2989

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

Closed
smarter opened this issue Aug 16, 2017 · 0 comments
Closed

Comments

@smarter
Copy link
Member

smarter commented Aug 16, 2017

class Foo[+X[_]] {
  // OK
  def foo1[Y[_]](right: Foo[Y]): Foo[Y] = right
  // OK
  def foo2[Y[_]](right: Foo[[T] => Y[T]]): Foo[Y] = right
  // OK
  def foo3[Y[_]](right: Foo[[T] => Y[T]]): Foo[[T] => Y[T]] = right
  // Error:
  //   found:    Foo[Y](right)
  //   required: Foo[Y]
  def foo4[Y[_]](right: Foo[Y]): Foo[[T] => Y[T]] = right
}
@smarter smarter changed the title Y not considered a subtype of [T] => Y[T] in some situations Type constructorY not considered a subtype of [T] => Y[T] in some situations Aug 16, 2017
@smarter smarter changed the title Type constructorY not considered a subtype of [T] => Y[T] in some situations HK type parameterY not considered a subtype of [T] => Y[T] in some situations Aug 16, 2017
smarter added a commit to smarter/dotty that referenced this issue Sep 2, 2017
smarter added a commit to smarter/dotty that referenced this issue Sep 2, 2017
Slightly relax the conditions under which we eta-reduce to account for
this case.
smarter added a commit to dotty-staging/dotty that referenced this issue Nov 22, 2017
Slightly relax the conditions under which we eta-reduce to account for
this case.
smarter added a commit to dotty-staging/dotty that referenced this issue Dec 13, 2017
Slightly relax the conditions under which we eta-reduce to account for
this case.
odersky referenced this issue Dec 30, 2017
Add missing case to TypeComparer
@odersky odersky closed this as completed Dec 30, 2017
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