From e6cee2627555f379ef6cd8cd554a1079a7e074aa Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 2 Dec 2013 16:13:57 +0100 Subject: SI-8024 Fix inaccurate message on overloaded ambiguous ident `Symbol#owner` of an overloaded symbol doesn't necessarily correspond to the owner of any of the alternatives, and as such it shouldn't be used in error message. neg/t8024.scala actually represents a progression since 2.10.3; the ambiguity was not reported. I bisected the change to https://github.com/scala/scala/pull/1554. --- test/files/neg/t8024b.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/files/neg/t8024b.scala (limited to 'test/files/neg/t8024b.scala') diff --git a/test/files/neg/t8024b.scala b/test/files/neg/t8024b.scala new file mode 100644 index 0000000000..cf3d496365 --- /dev/null +++ b/test/files/neg/t8024b.scala @@ -0,0 +1,17 @@ +package p + +trait NRoot[A] + +object FastComplex { + final def sqrt(x: Double): Double = Math.sqrt(x) + final def sqrt[A](a: A)(implicit ev: NRoot[A]): A = ??? + + object Inner { + import java.lang.Math.sqrt + + // wrong message: + // error: reference to sqrt is ambiguous; + // it is both defined in object FastComplex and imported subsequently by + sqrt(0d) + } +} -- cgit v1.2.3