@@ -443,6 +443,56 @@ class LateExpansion {
443443 """ )
444444 }
445445
446+ @ Test def testByNameOwner (): Unit = {
447+ val result = run(
448+ """
449+ import scala.async.run.late.{autoawait,lateasync}
450+ object Bleh {
451+ @autoawait @lateasync def asyncCall(): Int = 0
452+ def byName[T](fn: => T): T = fn
453+ }
454+ object Boffo {
455+ @autoawait @lateasync def jerk(): Unit = {
456+ val pointlessSymbolOwner = 1 match {
457+ case _ =>
458+ Bleh.asyncCall()
459+ Bleh.byName {
460+ val whyDoHateMe = 1
461+ whyDoHateMe
462+ }
463+ }
464+ }
465+ }
466+ object Test {
467+ @lateasync def test() = Boffo.jerk()
468+ }
469+ """ )
470+ }
471+
472+ @ Test def testByNameOwner2 (): Unit = {
473+ val result = run(
474+ """
475+ import scala.async.run.late.{autoawait,lateasync}
476+ object Bleh {
477+ @autoawait @lateasync def bleh = Bleh
478+ def byName[T](fn: => T): T = fn
479+ }
480+ object Boffo {
481+ @autoawait @lateasync def slob(): Unit = {
482+ val pointlessSymbolOwner = {
483+ Bleh.bleh.byName {
484+ val whyDoHateMeToo = 1
485+ whyDoHateMeToo
486+ }
487+ }
488+ }
489+ }
490+ object Test {
491+ @lateasync def test() = Boffo.slob()
492+ }
493+ """ )
494+ }
495+
446496 private def createTempDir (): File = {
447497 val f = File .createTempFile(" output" , " " )
448498 f.delete()
@@ -455,9 +505,9 @@ class LateExpansion {
455505 try {
456506 val reporter = new StoreReporter
457507 val settings = new Settings (println(_))
458- // settings.processArgumentString("-Xprint:refchecks,patmat,postpatmat,jvm -nowarn")
459508 settings.outdir.value = out.getAbsolutePath
460509 settings.embeddedDefaults(getClass.getClassLoader)
510+ // settings.processArgumentString("-Xprint:patmat,postpatmat,jvm -nowarn")
461511 val isInSBT = ! settings.classpath.isSetByUser
462512 if (isInSBT) settings.usejavacp.value = true
463513 val global = new Global (settings, reporter) {
0 commit comments