Skip to content

Commit

Permalink
SI-5353, imperfect error message.
Browse files Browse the repository at this point in the history
[backport]
The fix of course is a perfect error message.
  • Loading branch information
paulp committed Jan 30, 2013
1 parent 77ec4ef commit f3f1e50
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/compiler/scala/tools/nsc/symtab/classfile/Pickler.scala
Expand Up @@ -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
}
Expand Down
4 changes: 4 additions & 0 deletions 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
3 changes: 3 additions & 0 deletions test/files/neg/t5353.scala
@@ -0,0 +1,3 @@
class A {
def f(x: Boolean) = if (x) Array("abc") else Array()
}
2 changes: 1 addition & 1 deletion 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
2 changes: 1 addition & 1 deletion 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

0 comments on commit f3f1e50

Please sign in to comment.