Skip to content

Commit 844ad0e

Browse files
committed
Mention scala.language.implicitConversions
1 parent 3ab5bcc commit 844ad0e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/docs/reference/changed/implicit-conversions.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ This conversion can be either:
2121
1. An `implicit def` of type `T => S` or `(=> T) => S`
2222
1. An implicit value of type `ImplicitConverter[T, S]`
2323

24+
Defining an implicit conversion will emit a warning unless the import
25+
`scala.language.implicitConversions` is in scope, or the flag
26+
`-language:implicitConversions` is given to the compiler.
27+
2428
## Examples
2529

2630
The first example is taken from `scala.Predef`. Thanks to this
@@ -38,6 +42,7 @@ The second example shows how to use `ImplicitConverter` to define an
3842
types:
3943

4044
```scala
45+
import scala.language.implicitConversions
4146
implicit def ordT[T, S](
4247
implicit conv: ImplicitConverter[T, S],
4348
ordS: Ordering[S]

0 commit comments

Comments
 (0)