Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@joroKr21
Copy link
Contributor

Fix #9352
/claim #9352

Comment on lines +216 to +231
},
test("takes trace from the implicit scope") {
var numTraces: Int = 0
val layer = {
implicit def trace: Trace = {
numTraces += 1
Trace.empty
}

ZLayer.make[String](
ZLayer.succeed(42),
ZLayer.fromFunction((_: Int).toString)
)
}

assertZIO(layer.build.as(numTraces))(equalTo(3))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, at least now I won't have to remember why we had to do use explicit tags in the macros in the future πŸ₯²

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was really hard to come up with 🀣

@kyri-petrou kyri-petrou merged commit 65a35bc into zio:series/2.x Dec 2, 2024
18 checks passed
@joroKr21 joroKr21 deleted the zlayer/trace branch December 2, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ambiguous implicit value for zio.Trace with ZIO 2.1.13

2 participants