Skip to content

Commit 5d4b11d

Browse files
bishaboshajulienrf
authored andcommitted
port library authors guide to Scala 3
1 parent a726a55 commit 5d4b11d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

_overviews/contributors/index.md

+21
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,8 @@ code fences have been updated to also include the result of evaluating the Scala
473473
Another approach consists in embedding fragments of Scala source files that are part of a module which
474474
is compiled by your build. For instance, given the following test in file `src/test/ch/epfl/scala/Usage.scala`:
475475

476+
{% tabs usage-definition class=tabs-scala-version %}
477+
{% tab 'Scala 2' %}
476478
~~~ scala
477479
package ch.epfl.scala
478480

@@ -489,6 +491,25 @@ object Usage extends Scalaprops {
489491

490492
}
491493
~~~
494+
{% endtab %}
495+
{% tab 'Scala 3' %}
496+
~~~ scala
497+
package ch.epfl.scala
498+
499+
import scalaprops.{Property, Scalaprops}
500+
501+
object Usage extends Scalaprops:
502+
503+
val testDoNothing =
504+
// #do-nothing
505+
Property.forAll: (x: Int) =>
506+
Example.doNothing(x) == x
507+
// #do-nothing
508+
509+
end Usage
510+
~~~
511+
{% endtab %}
512+
{% endtabs %}
492513

493514
You can embed the fragment surrounded by the `#do-nothing` identifiers with the `@@snip` Paradox directive,
494515
as shown in the `src/documentation/reference.md` file:

0 commit comments

Comments
 (0)