Skip to content

Commit 09a46f1

Browse files
committed
Add example
1 parent 5664de0 commit 09a46f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/docs/reference/contextual/givens.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ trait Show[T] {
111111
inline given Show[Foo] with {
112112
/*transparent*/ inline def show(x: Foo): String = ${ ... }
113113
}
114+
115+
def app =
116+
// inlines `show` method call and removes the call to `given Show[Foo]`
117+
summon[Show[Foo]].show(foo)
114118
```
115119
Note that the inline methods within the given instances may be `transparent`.
116120

0 commit comments

Comments
 (0)