You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "AndreyT (JIRA)" <ji...@apache.org> on 2016/12/02 09:48:58 UTC

[jira] [Updated] (GROOVY-8015) Strange groovy behavior

     [ https://issues.apache.org/jira/browse/GROOVY-8015?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

AndreyT updated GROOVY-8015:
----------------------------
    Description: 
{code}
String s = 'anyString'
Long l = 1

def m = [(s): [l]] as Map<String,List<Long>>
def g = 1
{code}

Code above cause exception:

{code}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/tmp/t.groovy: 5: expecting EOF, found 'def' @ line 5, column 1.
{code}

If add `;` at the end of `def m = [(s): [l]] as Map<String,List<Long>>`, then all works fine.

  was:
{code}
String s = 'anyString'
Long l = 1

def m = [(s): [l]] as Map<String,List<Long>>
def g = 1
{code}

Code above cause exception:

{code}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
/tmp/t.groovy: 5: expecting EOF, found 'def' @ line 5, column 1.
{code}

If add `;` at the end of `def m = [(s): [1]] as Map<String,List<Long>>`, then all works fine.


> Strange groovy behavior
> -----------------------
>
>                 Key: GROOVY-8015
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8015
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.4.5
>         Environment: groovy -v
> Groovy Version: 2.4.5 JVM: 1.8.0_112 Vendor: Oracle Corporation OS: Linux
> java -version
> java version "1.8.0_112"
> Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
> Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
>            Reporter: AndreyT
>            Priority: Trivial
>
> {code}
> String s = 'anyString'
> Long l = 1
> def m = [(s): [l]] as Map<String,List<Long>>
> def g = 1
> {code}
> Code above cause exception:
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
> /tmp/t.groovy: 5: expecting EOF, found 'def' @ line 5, column 1.
> {code}
> If add `;` at the end of `def m = [(s): [l]] as Map<String,List<Long>>`, then all works fine.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)