-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Abstract type bound of type member is forgotten? #4884
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
Labels
Comments
The code should indeed compile. FWIW you probably want to use the latest RC, but this code still fails on latest master (429c1f2). |
Blaisorblade
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 4, 2018
In this code we fetch the type parameter bounds from the definition, so we must substitute their definition using `asSeenFrom` with the correct prefix. The correct prefix is however hard to find: `TypeApplications.typeParams` finds a `self: TypeRefs` (after however many steps), the correct prefix is `self.prefix`. In fact, a compositional typing rule would obtain the bounds from the type (or, well, kind) of the type constructor; that would avoid the need for using `asSeenFrom`. We only have a way to obtain such a kind for `NamedType` (where we can take the `info`). That might be enough, but there might be another way to fix this.
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 7, 2018
odersky
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 7, 2018
- Type parameters of hk lambdas depend on prefix, can't be computed from symbol if prefix is non-trivial - Parameter bounds of such type parameters are already computed, so can be retrieved with paramInfo. The doc comment of paramInfoAsSeenFrom indicates this, but the implementation did something different. - Typer and Checking need to call paramInfoAsSeenFrom to get the right bounds in general. This also fixes scala#4884.
Blaisorblade
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 7, 2018
In this code we fetch the type parameter bounds from the definition, so we must substitute their definition using `asSeenFrom` with the correct prefix. The correct prefix is however hard to find: `TypeApplications.typeParams` finds a `self: TypeRefs` (after however many steps), the correct prefix is `self.prefix`. In fact, a compositional typing rule would obtain the bounds from the type (or, well, kind) of the type constructor; that would avoid the need for using `asSeenFrom`. We only have a way to obtain such a kind for `NamedType` (where we can take the `info`). However, that seems enough.
Blaisorblade
added a commit
to dotty-staging/dotty
that referenced
this issue
Aug 7, 2018
In this code we fetch the type parameter bounds from the definition, so we must substitute their definition using `asSeenFrom` with the correct prefix. The correct prefix is however hard to find: `TypeApplications.typeParams` finds a `self: TypeRefs` (after however many steps), the correct prefix is `self.prefix`. In fact, a compositional typing rule would obtain the bounds from the type (or, well, kind) of the type constructor; that would avoid the need for using `asSeenFrom`. We only have a way to obtain such a kind for `NamedType` (where we can take the `info`). However, that seems enough.
allanrenucci
pushed a commit
to dotty-staging/dotty
that referenced
this issue
Aug 8, 2018
- Type parameters of hk lambdas depend on prefix, can't be computed from symbol if prefix is non-trivial - Parameter bounds of such type parameters are already computed, so can be retrieved with paramInfo. The doc comment of paramInfoAsSeenFrom indicates this, but the implementation did something different. - Typer and Checking need to call paramInfoAsSeenFrom to get the right bounds in general. This also fixes scala#4884.
odersky
added a commit
that referenced
this issue
Aug 8, 2018
Fix #4884: Fix handling of bounds of type lambdas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This compiles in Scala 2.12.1 and does not compile in Dotty 0.8.0. Just reporting this but I might have overlooked some dropped features.
The text was updated successfully, but these errors were encountered: