Skip to content

Orphan PolyParam when typing overloaded array apply #670

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
odersky opened this issue Jun 19, 2015 · 0 comments · Fixed by #678
Closed

Orphan PolyParam when typing overloaded array apply #670

odersky opened this issue Jun 19, 2015 · 0 comments · Fixed by #678

Comments

@odersky
Copy link
Contributor

odersky commented Jun 19, 2015

dotc ../pending/pos/t8230a.scala
error while pickling type T
error when pickling type T'
error when pickling tree Arr.apply[T']
error when pickling tree Arr.applyT'
error when pickling tree I.arrToTravString'
error when pickling tree Test.foo(I.arrToTravString')
error when pickling tree () extends Object() { this: Test.Okay.type =>
Arr.applyString'
import I.{arrToTrav, longArrToTrav}
Test.foo(I.arrToTravString')
}
error when pickling tree final module class Okay$() extends Object() { this: Test.Okay.type =>
Arr.applyString'
import I.{arrToTrav, longArrToTrav}
Test.foo(I.arrToTravString')
}
error when pickling tree () extends Object() { this: Test.type =>
def foo(t: scala.collection.Traversable[Any]): Unit = {
()
}
final lazy module val Okay: Test.Okay$ = new Test.Okay$()
final module class Okay$() extends Object() { this: Test.Okay.type =>
Arr.applyString'
import I.{arrToTrav, longArrToTrav}
Test.foo(I.arrToTravString')
}
final lazy module val Fail: Test.Fail$ = new Test.Fail$()
final module class Fail$() extends Object() { this: Test.Fail.type =>
import I.arrToTrav
Test.foo(I.arrToTravString')
}
}
error when pickling tree final module class Test$() extends Object() { this: Test.type =>
def foo(t: scala.collection.Traversable[Any]): Unit = {
()
}
final lazy module val Okay: Test.Okay$ = new Test.Okay$()
final module class Okay$() extends Object() { this: Test.Okay.type =>
Arr.applyString'
import I.{arrToTrav, longArrToTrav}
Test.foo(I.arrToTravString')
}
final lazy module val Fail: Test.Fail$ = new Test.Fail$()
final module class Fail$() extends Object() { this: Test.Fail.type =>
import I.arrToTrav
Test.foo(I.arrToTravString')
}
}
error when pickling tree package {
final lazy module val Test: Test$ = new Test$()
final module class Test$() extends Object() { this: Test.type =>
def foo(t: scala.collection.Traversable[Any]): Unit = {
()
}
final lazy module val Okay: Test.Okay$ = new Test.Okay$()
final module class Okay$() extends Object() { this: Test.Okay.type =>
Arr.applyString'
import I.{arrToTrav, longArrToTrav}
Test.foo(I.arrToTravString')
}
final lazy module val Fail: Test.Fail$ = new Test.Fail$()
final module class Fail$() extends Object() { this: Test.Fail.type =>
import I.arrToTrav
Test.foo(I.arrToTravString')
}
}
}
exception occurred while compiling ../pending/pos/t8230a.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: orphan poly parameter: PolyParam(T)
at scala.Predef$.assert(Predef.scala:165)
at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType$1(TreePickler.scala:253)
at dotty.tools.dotc.core.tasty.TreePickler.dotty$tools$dotc$core$tasty$TreePickler$$pickleType$1(TreePickler.scala:132)
at dotty.tools.dotc.core.tasty.TreePickler.dotty$tools$dotc$core$tasty$TreePickler$$pickleTpt$1(TreePickler.scala:288)

odersky added a commit to dotty-staging/dotty that referenced this issue Jun 19, 2015
odersky added a commit to dotty-staging/dotty that referenced this issue Jun 22, 2015
There were two instances where a constraint undergoing a replace would still refer
to poly params that are no longer bound after the replace.

1. In an ordering the replaced parameters was n ot removed from the bounds of the others.
2. When a parameter refers to the replaced parameter in a type, (not a TypeBounds), the
replaced parameter was not replaced.

We now have checking in place that in globally committable typer states, TypeVars are not instantiated
to PolyParams and (configurable) that constraints of such typer states are always closed.

Fixes scala#670.
odersky added a commit that referenced this issue Jun 25, 2015
Avoid junk produced by Constraint#replace.
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.

1 participant