From 1206dad07320edd764f784867a2fd0c822a2ea40 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 17 Dec 2018 14:31:03 +0100 Subject: [PATCH] Fix #5346: Refine implicit resolution spec Add discussion of by-name parameters. --- docs/docs/reference/changed/implicit-resolution.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/docs/reference/changed/implicit-resolution.md b/docs/docs/reference/changed/implicit-resolution.md index 738a591aa53b..62bc17fc2735 100644 --- a/docs/docs/reference/changed/implicit-resolution.md +++ b/docs/docs/reference/changed/implicit-resolution.md @@ -72,5 +72,13 @@ affect implicits on the language level. most (but not all) divergence errors in Scala 2 would terminate the implicit search as a whole. + 5. Scala-2 gives a lower level of priority to implicit conversions with call-by-name + parameters relative to implicit conversions with call-by-value parameters. Dotty + drops this distinction. So the following code snippet would be ambiguous in Dotty: + + implicit def conv1(x: Int): A = new A(x) + implicit def conv2(x: => Int): A = new A(x) + def buzz(y: A) = ??? + buzz(1) // error: ambiguous [//]: # todo: expand with precise rules