Skip to content

Missing outer accessor instead of error for export and ctor proxy #24879

@som-snytt

Description

@som-snytt

Compiler version

3.8.1-RC1-bin-SNAPSHOT-nonbootstrapped
at 32e416e

Minimized code

class C:
  class D

class Baz:
  val c = new C
  export c.*

@main def Test =
  println:
    Baz().D()

Output (click arrow to expand)

during erasure...

Details
Exception in thread "main" java.lang.AssertionError: assertion failed: missing outer accessor in the top-level definitions in package <empty>
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:10)
        at dotty.tools.dotc.transform.ExplicitOuter$.dotty$tools$dotc$transform$ExplicitOuter$$$outerParamAccessor(ExplicitOuter.scala:234)
        at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.loop$1(ExplicitOuter.scala:458)
        at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.path$extension(ExplicitOuter.scala:467)
        at dotty.tools.dotc.ast.tpd$.followOuterLinks(tpd.scala:520)
        at dotty.tools.dotc.ast.tpd$.ref(tpd.scala:492)
        at dotty.tools.dotc.ast.tpd$.singleton(tpd.scala:526)
        at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.outerArg$1(ExplicitOuter.scala:413)
        at dotty.tools.dotc.transform.ExplicitOuter$OuterOps$.args$extension(ExplicitOuter.scala:421)
        at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:823)
        at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3790)
        at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3884)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3971)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:3976)
        at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:4087)
        at dotty.tools.dotc.transform.Erasure$Typer.$anonfun$7(Erasure.scala:826)
        at dotty.tools.dotc.core.Decorators$.zipWithConserve(Decorators.scala:160)
        at dotty.tools.dotc.transform.Erasure$Typer.typedApply(Erasure.scala:826)

Expected

as on 3.8.0-RC4

25 |    Baz().D()
   |    ^^^^^^^^^
   |(Baz#c : C) is not a valid class prefix, since it is not an immutable path
   |
   | longer explanation available when compiling with `-explain`
1 error found
Compilation failed

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions