AndreVanDelft / scala

The SubScript extension to the Scala programming language
http://www.subscript-lang.org/
12 stars 1 forks source link

Invalid compiler error messages raised on [key,?c println("")] #16

Open AndreVanDelft opened 10 years ago

AndreVanDelft commented 10 years ago

Input:

  def script..
   key(??c: Char) = (-)
   main(args: Array[String]) = val c: Char = ' '
                               key,?c  {println(s"key =>  $c")}
                               key,'x' {println(s"key <= x=>  $c")}

yielded

[quick.subscript]  error: terms in comma expression should be path or literal
[quick.subscript]                                key,?c  println(s"key =>  $c")
[quick.subscript]                                ^

It is not a problem for the 'x' parameter. Putting the parameter ?c between classic parentheses makes the error message disappear. So actual ? and ?? parameters are currently not allowed in comma expressions, but they should be.

There is another problem, popping up when ?c is between parentheses:

[quick.subscript] error: not found: value _println
[quick.subscript]                                key(?c)  println(s"key =>  $c")
[quick.subscript]                                         ^

This goes away when println(...) is put between braces, but that should not be necessary.