From d9c0cb6165bd60d79bdf764291c417c86623b042 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 21 Aug 2012 07:15:27 +0200 Subject: Suppressed 'possible cause' mis-warning. I have seen this warning a bunch of times and it has not yet been close to right. --- test/files/buildmanager/t2650_3/t2650_3.check | 1 - test/files/buildmanager/t2650_4/t2650_4.check | 1 - test/files/neg/not-possible-cause.check | 10 ++++++++++ test/files/neg/not-possible-cause.scala | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 test/files/neg/not-possible-cause.check create mode 100644 test/files/neg/not-possible-cause.scala (limited to 'test/files') diff --git a/test/files/buildmanager/t2650_3/t2650_3.check b/test/files/buildmanager/t2650_3/t2650_3.check index c109800d9c..5c6326d59f 100644 --- a/test/files/buildmanager/t2650_3/t2650_3.check +++ b/test/files/buildmanager/t2650_3/t2650_3.check @@ -10,6 +10,5 @@ B.scala:2: error: type mismatch; found : a.T (which expands to) Long required: Int - possible cause: missing arguments for method or constructor def x(a: A): Int = a.x ^ diff --git a/test/files/buildmanager/t2650_4/t2650_4.check b/test/files/buildmanager/t2650_4/t2650_4.check index 89536776bd..a4aeaddfbb 100644 --- a/test/files/buildmanager/t2650_4/t2650_4.check +++ b/test/files/buildmanager/t2650_4/t2650_4.check @@ -10,6 +10,5 @@ B.scala:2: error: type mismatch; found : a.T2 (which expands to) Long required: Int - possible cause: missing arguments for method or constructor def x(a: A): Int = a.x ^ diff --git a/test/files/neg/not-possible-cause.check b/test/files/neg/not-possible-cause.check new file mode 100644 index 0000000000..9111cd0d3d --- /dev/null +++ b/test/files/neg/not-possible-cause.check @@ -0,0 +1,10 @@ +not-possible-cause.scala:2: error: type mismatch; + found : a.type (with underlying type A) + required: AnyRef +Note that implicit conversions are not applicable because they are ambiguous: + both method any2stringfmt in object Predef of type (x: Any)scala.runtime.StringFormat + and method any2stringadd in object Predef of type (x: Any)scala.runtime.StringAdd + are possible conversion functions from a.type to AnyRef + def foo[A <: Product](a: A) { type X = a.type } + ^ +one error found diff --git a/test/files/neg/not-possible-cause.scala b/test/files/neg/not-possible-cause.scala new file mode 100644 index 0000000000..83ec24dec8 --- /dev/null +++ b/test/files/neg/not-possible-cause.scala @@ -0,0 +1,3 @@ +object Foo { + def foo[A <: Product](a: A) { type X = a.type } +} -- cgit v1.2.3