Skip to content

Commit

Permalink
support run method without extension syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
fwbrasil committed Jun 2, 2023
1 parent 4868054 commit 848cc1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zio-direct-test/src/test/scala/zio/direct/VariaSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ object VariaSpec extends DeferRunSpec { //
lazy val x = 123
"""
}
},
test("supports run method without extension syntax") {
@directRunCall
def await[T](v: Task[T]): T = ???
class Blah(val value: Int)
runLiftTest(1) {
await(ZIO.succeed(1))
}
}
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ object Extractors {
tree match
case DottyExtensionCall.OneArg(invocation @ DirectRunCallAnnotated.Term(), effect) =>
Some(effect.asExpr)
case quotes.reflect.Apply(quotes.reflect.TypeApply(invocation @ DirectRunCallAnnotated.Term(), _), effect :: Nil) =>
Some(effect.asExpr)
case _ =>
None
}
Expand Down

0 comments on commit 848cc1a

Please sign in to comment.