File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
docs/docs/reference/changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,15 @@ Views are applied in three situations:
4848In Scala 2, views whose parameters are passed by-value take precedence
4949over views whose parameters are passed by-name. This is no longer the
5050case in Scala 3. A type error reporting the ambiguous conversions will
51- be emitted in cases where this rule would be applied in Scala 2.
51+ be emitted in cases where this rule would be applied in Scala 2:
52+
53+ ``` scala
54+ implicit def conv1 (x : Int ): String = x.toString
55+ implicit def conv2 (x : => Int ): String = x.toString
56+
57+ val x : String = 0 // Compiles in Scala2 (uses `conv1`),
58+ // type error in Scala 3 because of ambiguity.
59+ ```
5260
5361In Scala 2, implicit values of a function type would be considered as
5462potential views. In Scala 3, these implicit value need to have type
You can’t perform that action at this time.
0 commit comments