diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-08-03 11:02:11 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-08-06 11:02:59 -0700 |
commit | 9d5c97cb0155c0a2d375be6904eef8f882970615 (patch) | |
tree | c8be3a12c2e9dbbbbaabc96132ed0350024802ce /src/library | |
parent | 6917ccab44a592ced4cae7dad1b9b92978748dd5 (diff) | |
download | scala-9d5c97cb0155c0a2d375be6904eef8f882970615.tar.gz scala-9d5c97cb0155c0a2d375be6904eef8f882970615.tar.bz2 scala-9d5c97cb0155c0a2d375be6904eef8f882970615.zip |
StringContext#checkLengths reports bad args count
Since interpolator args are of type Any, it's easy
to write s(args) instead of s(args: _*). I wonder
if Xlint would have warned me about that.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/StringContext.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/library/scala/StringContext.scala b/src/library/scala/StringContext.scala index 42fb2f36e8..70f95750da 100644 --- a/src/library/scala/StringContext.scala +++ b/src/library/scala/StringContext.scala @@ -59,7 +59,8 @@ case class StringContext(parts: String*) { */ def checkLengths(args: Seq[Any]): Unit = if (parts.length != args.length + 1) - throw new IllegalArgumentException("wrong number of arguments for interpolated string") + throw new IllegalArgumentException("wrong number of arguments ("+ args.length + +") for interpolated string with "+ parts.length +" parts") /** The simple string interpolator. |