Skip to content

Pickler/Unpickler dealias too eagerly #4988

Closed
@allanrenucci

Description

@allanrenucci
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions