diff options
author | Paul Phillips <paulp@improving.org> | 2013-09-27 09:25:37 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-09-27 09:42:37 -0700 |
commit | 7fa77afa9322d4d31b132d1c1c8b57c7a3199348 (patch) | |
tree | 17bef811bee14d52333af56120a802d02a013948 /test | |
parent | 1a3c16fd36407bb2308bbb84739601544ac4a2e5 (diff) | |
download | scala-7fa77afa9322d4d31b132d1c1c8b57c7a3199348.tar.gz scala-7fa77afa9322d4d31b132d1c1c8b57c7a3199348.tar.bz2 scala-7fa77afa9322d4d31b132d1c1c8b57c7a3199348.zip |
SI-3971 error message carat mispoints at curried methods.
Point at the beginning of the first argument list when
reporting an error, as this is most easily associated with
the application taking place (which may involve multiple
applies in succession.)
Thanks to retronym for figuring out why issuing a better
error message broke the compiler on non-erroneous compile runs.
The changes to "treesInResult" are the consequence.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t3971.check | 21 | ||||
-rw-r--r-- | test/files/neg/t3971.scala | 12 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/files/neg/t3971.check b/test/files/neg/t3971.check new file mode 100644 index 0000000000..8685119876 --- /dev/null +++ b/test/files/neg/t3971.check @@ -0,0 +1,21 @@ +t3971.scala:6: error: type mismatch; + found : Int + required: String + f(g("abc")("def")) // g returns Int, needs String + ^ +t3971.scala:7: error: type mismatch; + found : Int(5) + required: String + f(5) + ^ +t3971.scala:8: error: type mismatch; + found : Int + required: String + f(h("abc")) + ^ +t3971.scala:11: error: type mismatch; + found : Boolean + required: String + ({"ab".reverse; "ba".equals})(0): String + ^ +four errors found diff --git a/test/files/neg/t3971.scala b/test/files/neg/t3971.scala new file mode 100644 index 0000000000..35f64fde0c --- /dev/null +++ b/test/files/neg/t3971.scala @@ -0,0 +1,12 @@ +class A { + def f(x: String) = x + def g(x: String)(y: String): Int = x.length + y.length + def h(x: String) = x.length + + f(g("abc")("def")) // g returns Int, needs String + f(5) + f(h("abc")) + + // a perverse piece of code from a perverse coder + ({"ab".reverse; "ba".equals})(0): String +} |