[ 
https://issues.apache.org/jira/browse/GROOVY-8131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15942491#comment-15942491
 ] 

Jochen Theodorou commented on GROOVY-8131:
------------------------------------------

"static final SimpleDateFormat s3" is legal if you have a static initializer 
block, that sets the variable. But you need to put some semantics into the 
evaluation to determine that, which is why lexer and parser see that as valid 
statement.

Why would we make newline part of the language? Well because the semicolon is 
annoying ;) Seriously, if you did Groovy for a while and then go to Java, the 
semicolon because extremely annoying.


> Statement continued onto next line is flagged when first character is "="
> -------------------------------------------------------------------------
>
>                 Key: GROOVY-8131
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8131
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.5
>         Environment: Ubuntu Linux
> `uname -a`:
> Linux biostar 4.4.0-69-generic #90-Ubuntu SMP Thu Mar 16 16:52:31 UTC 2017 
> x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Richard Elkins
>            Priority: Minor
>         Attachments: grbug.java
>
>
> Source code attached (grbug.java).
> `javac` v8 compiles variable declarations s1, s2, and s3 successfully.
> `groovyc` flags s3:
> "unexpected token: = @ line 9, column 3."



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to