diff options
author | James Iry <jamesiry@gmail.com> | 2013-01-23 11:57:06 -0800 |
---|---|---|
committer | James Iry <jamesiry@gmail.com> | 2013-01-23 11:57:06 -0800 |
commit | 8297843765c7195bb7c3ad30e91de6779b9bff99 (patch) | |
tree | 7f5913fa767f7205b54967e366222549f6a065b5 /test/files/run/t6434.scala | |
parent | 884737c75dc7f2765a3d769342ecc832deeddb81 (diff) | |
download | scala-8297843765c7195bb7c3ad30e91de6779b9bff99.tar.gz scala-8297843765c7195bb7c3ad30e91de6779b9bff99.tar.bz2 scala-8297843765c7195bb7c3ad30e91de6779b9bff99.zip |
SI-6434 Pretty print function types with by name arg as (=> A) => B
We were pretty printing a function type with one by name arg as
=> A => B, but because => is right associative that's formally
equivalent to => (A => B) and that's entirely a different thing. This
commit changes the pretty printer in Typers.scala to check for a
byname argument on a function type and wrap it in parens. A REPL test
is included.
Diffstat (limited to 'test/files/run/t6434.scala')
-rw-r--r-- | test/files/run/t6434.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/files/run/t6434.scala b/test/files/run/t6434.scala new file mode 100644 index 0000000000..e4a4579613 --- /dev/null +++ b/test/files/run/t6434.scala @@ -0,0 +1,8 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = +"""def f(x: => Int): Int = x +f _ +""" +} |