Skip to content

Compiler crash when accessing member inside auxiliary constructor #10035

@scabug

Description

@scabug
trait Inner {
  def f(): Outer
}

class Outer(o: Set[Inner]) {
  def this() = this(Set(1).map{
    case k => new Inner {
      def f(): Outer = Outer.this
    }
  })
}
Exception in thread "main" scala.reflect.internal.Types$TypeError: value <none> is not a member of <notype>
	at scala.tools.nsc.typechecker.Contexts$ThrowingReporter.handleError(Contexts.scala:1402)
	at scala.tools.nsc.typechecker.Contexts$ContextReporter.issue(Contexts.scala:1254)
	at scala.tools.nsc.typechecker.Contexts$Context.issue(Contexts.scala:573)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$normalTypedApply$1$1.apply(Typers.scala:4549)
	at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$normalTypedApply$1$1.apply(Typers.scala:4548)
	at scala.tools.nsc.typechecker.Typers$Typer.onError$3(Typers.scala:4522)
	at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4548)
	at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4580)
	at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5343)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions