File tree 1 file changed +9
-1
lines changed
docs/docs/reference/changed
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:
48
48
In Scala 2, views whose parameters are passed by-value take precedence
49
49
over views whose parameters are passed by-name. This is no longer the
50
50
case 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
+ ```
52
60
53
61
In Scala 2, implicit values of a function type would be considered as
54
62
potential views. In Scala 3, these implicit value need to have type
You can’t perform that action at this time.
0 commit comments