Skip to content

Pickler/Unpickler dealias too eagerly #4988

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
allanrenucci opened this issue Aug 22, 2018 · 1 comment
Closed

Pickler/Unpickler dealias too eagerly #4988

allanrenucci opened this issue Aug 22, 2018 · 1 comment

Comments

@allanrenucci
Copy link
Contributor

object Trees {
  class PackageDef
  class ValDef
}

class ReplCompiler {
  type PackageDef = Trees.PackageDef
  type ValDef = Trees.ValDef

  def errors[A]: A = ???
  def success: ValDef = ???

  def typeCheck(cond: Boolean): ValDef =
    if (cond) success else errors // failure goes away with `errors[ValDef]`
}
> dotc ReplCompiler.scala -Ytest-pickler -Xprint-types
Exception in thread "main" class dotty.tools.dotc.reporting.diagnostic.messages$Error at ?: pickling difference for class ReplCompiler in ReplCompiler.scala, for details:
                   |
                   |  diff before-pickling.txt after-pickling.txt
	at dotty.tools.dotc.reporting.Reporting.error(Reporter.scala:96)
...

> diff before-pickling.txt after-pickling.txt 
27c27
<       :ReplCompiler.this.ValDef>
---
>       :Trees.ValDef>

Minimised from #4915

allanrenucci added a commit to dotty-staging/dotty that referenced this issue Aug 22, 2018
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Aug 22, 2018
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Aug 28, 2018
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Aug 28, 2018
allanrenucci added a commit to dotty-staging/dotty that referenced this issue Sep 3, 2018
@panacekcz
Copy link
Contributor

Let me add another reproduction, loosely based on tests/pos/t8237.scala:

object TI {
  class LA
  type LB[T] = LA
  trait TC[T]
  def fTt[E[X] <: LB[X]](tt: TC[E[Int]]) = 1
  def tc[T]: TC[T] = ???
  fTt(tc)
}

dotc -Ytest-pickler TI.scala:

exception occurred while compiling TI.scala
class dotty.tools.dotc.reporting.diagnostic.messages$Error at ?: pickling difference for module class TI$ in TI.scala, for details:

diff before-pickling.txt after-pickling.txt

15c15
<     TI.fTt[TI.LB](TI.tc[TI.LB[scala.Int]])
---
>     TI.fTt[TI.LB](TI.tc[TI.LA])

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