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

Kind conformance error: Same bounds are considered stricter #5020

Closed
scabug opened this issue Sep 22, 2011 · 3 comments
Closed

Kind conformance error: Same bounds are considered stricter #5020

scabug opened this issue Sep 22, 2011 · 3 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Sep 22, 2011

Sample code:

sealed trait GenericList[U, M[_ <: U]] {
  type Transformed[N[MMA <: U]] <: GenericList[U, N]
}

trait GenericCons[U, M[_ <: U], T <: GenericList[U, M]] extends
GenericList[U, M] {
  type Transformed[N[MMB <: U]] = GenericCons[U, N, GenericList[U,
M]#Transformed[N]]
}

Expected behaviour:

Compiles

Actual behaviour:

Error message "kinds of the type arguments (N) do not conform to the expected kinds of
the type parameters (type N).
N's type parameters do not match type N's expected parameters: type
MMB's bounds >: Nothing <: U are stricter than type MMA's declared
bounds >: Nothing <: U"

(might be related to #3374)

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 22, 2011

Imported From: https://issues.scala-lang.org/browse/SI-5020?orig=1
Reporter: Lars Hupel (larsrh)
Affected Versions: 2.9.1

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 22, 2011

Lars Hupel (larsrh) said:
The same problem occurs for lower bounds:

sealed trait GenericList[L, M[_ >: L]] {
  type Transformed[N[MMA >: L]] <: GenericList[L, N]
}

trait GenericCons[L, M[_ >: L], T <: GenericList[L, M]] extends GenericList[L, M] {
  type Transformed[N[MMB >: L]] = GenericCons[L, N, T#Transformed[N]]
}
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jan 7, 2012

@paulp said:
I think this is fixed in a6ebd0f3ee .

@scabug scabug closed this Jan 7, 2012
@scabug scabug added this to the 2.10.0 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.