diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-29 16:24:43 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-29 18:05:26 -0700 |
commit | 75a075b507b1c3f4463ab0eb42fecde66978e903 (patch) | |
tree | 326818a7df5bd7959e7b5e7f770dbb80d1ef1355 | |
parent | 8886d22cd64e2bf861079873751455aeef9ee7a1 (diff) | |
download | scala-75a075b507b1c3f4463ab0eb42fecde66978e903.tar.gz scala-75a075b507b1c3f4463ab0eb42fecde66978e903.tar.bz2 scala-75a075b507b1c3f4463ab0eb42fecde66978e903.zip |
Fix for SI-5353, imperfect error message.
The fix of course is a perfect error message.
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala | 4 | ||||
-rw-r--r-- | test/files/neg/t5353.check | 4 | ||||
-rw-r--r-- | test/files/neg/t5353.scala | 3 | ||||
-rw-r--r-- | test/files/neg/t5692a.check | 2 | ||||
-rw-r--r-- | test/files/neg/t5692b.check | 2 |
5 files changed, 11 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala index 29b238c4cb..439e824aff 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala @@ -71,8 +71,8 @@ abstract class Pickler extends SubComponent { if (!t.isDef && t.hasSymbol && t.symbol.isTermMacro) { unit.error(t.pos, t.symbol.typeParams.length match { case 0 => "macro has not been expanded" - case 1 => "type parameter not specified" - case _ => "type parameters not specified" + case 1 => "this type parameter must be specified" + case _ => "these type parameters must be specified" }) return } diff --git a/test/files/neg/t5353.check b/test/files/neg/t5353.check new file mode 100644 index 0000000000..75e2435600 --- /dev/null +++ b/test/files/neg/t5353.check @@ -0,0 +1,4 @@ +t5353.scala:2: error: this type parameter must be specified + def f(x: Boolean) = if (x) Array("abc") else Array() + ^ +one error found diff --git a/test/files/neg/t5353.scala b/test/files/neg/t5353.scala new file mode 100644 index 0000000000..1ee869aac1 --- /dev/null +++ b/test/files/neg/t5353.scala @@ -0,0 +1,3 @@ +class A { + def f(x: Boolean) = if (x) Array("abc") else Array() +} diff --git a/test/files/neg/t5692a.check b/test/files/neg/t5692a.check index ded95a8820..7fbfb5dba7 100644 --- a/test/files/neg/t5692a.check +++ b/test/files/neg/t5692a.check @@ -1,4 +1,4 @@ -Test_2.scala:2: error: type parameter not specified +Test_2.scala:2: error: this type parameter must be specified def x = Macros.foo ^ one error found diff --git a/test/files/neg/t5692b.check b/test/files/neg/t5692b.check index e453870ec8..16796826b4 100644 --- a/test/files/neg/t5692b.check +++ b/test/files/neg/t5692b.check @@ -1,4 +1,4 @@ -Test_2.scala:2: error: type parameters not specified +Test_2.scala:2: error: these type parameters must be specified def x = Macros.foo ^ one error found |