aboutsummaryrefslogtreecommitdiff
path: root/tests/run/t7341.scala
blob: 812b316f9c944ac0b472fd55875eebdb8ef39737 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
object Obj {
  private var cache: Any = ()
  def returning(f: () => Unit) = ()
  def foo: Unit = {
    returning(() => cache = ())
  }

  def apply(): Any = {
    cache
  }
}

object Test extends dotty.runtime.LegacyApp {
  Obj()
}