When a field name ends with _ (and likely any other symbol), the ScalaWriter class generates parameters that look like fieldName_: String. Since there is no space between the _ and the :, the scala compiler assumes the : is part of the variable name and throws a syntax error.
The fix is to just put a space before the : I imagine. Here is a guess at the relevant lines in ScalaWriter:
I was exploring the use of generated case classes when I came across this bug, that won't work for me for unrelated reasons, but I won't be able to test any fixes here. I just thought I'd point out the bug.
When a field name ends with
_
(and likely any other symbol), the ScalaWriter class generates parameters that look likefieldName_: String
. Since there is no space between the_
and the:
, the scala compiler assumes the:
is part of the variable name and throws a syntax error. The fix is to just put a space before the:
I imagine. Here is a guess at the relevant lines in ScalaWriter:ScalaWriter.scala line 353:
I was exploring the use of generated case classes when I came across this bug, that won't work for me for unrelated reasons, but I won't be able to test any fixes here. I just thought I'd point out the bug.
Kevin