Skip to content

Orphan PolyParam #2152

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
propensive opened this issue Mar 30, 2017 · 1 comment
Closed

Orphan PolyParam #2152

propensive opened this issue Mar 30, 2017 · 1 comment

Comments

@propensive
Copy link
Contributor

The following causes the compiler to crash when trying to pickle some trees.

class Contra[-D](task: AnyRef)
object Test {
  def narrow(task: AnyRef): Contra[task.type] = new Contra(task)
  def ident[Before](elems: Contra[Before]): Contra[Before] = elems
  val foo = null
  ident(narrow(foo))
}

The output from the compiler is here.

@propensive propensive changed the title Pickling failure working with contravariant singleton type Pickling failure with contravariant singleton type Mar 30, 2017
@DarkDimius DarkDimius changed the title Pickling failure with contravariant singleton type Orphan PolyParam Mar 30, 2017
@DarkDimius
Copy link
Contributor

Exception in thread "main" java.lang.AssertionError: assertion failed: orphan poly parameter: PolyParam($param$1)

That's an actual error, unrelated to pickling. Likely from typer.

odersky added a commit to dotty-staging/dotty that referenced this issue Apr 10, 2017
scala#2152 shows that dependent result type parameters can end up in
the types of terms, so we have to eliminate them. If we don't we
get orphan parameters in pickling.
odersky added a commit to dotty-staging/dotty that referenced this issue Apr 10, 2017
scala#2152 shows that dependent result type parameters can end up in
the types of terms, so we have to eliminate them. If we don't we
get orphan parameters in pickling.
odersky added a commit to dotty-staging/dotty that referenced this issue Apr 10, 2017
odersky added a commit to dotty-staging/dotty that referenced this issue Apr 10, 2017
scala#2152 shows that dependent result type parameters can end up in
the types of terms, so we have to eliminate them. If we don't we
get orphan parameters in pickling.
Fix method name and comment
odersky added a commit that referenced this issue Apr 13, 2017
Fix #2152: Instantiate dependent result type parameters
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