Please sign in to comment.
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.
- Loading branch information...
Showing with 22 additions and 2 deletions.
|@@ -0,0 +1,10 @@|
|+Type in expressions to have them evaluated.|
|+Type :help for more information.|
|+scala> def f(x: => Int): Int = x|
|+f: (x: => Int)Int|
|+scala> f _|
|+res0: (=> Int) => Int = <function1>|