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

Paul King edited comment on GROOVY-7157 at 6/26/15 11:45 AM:
-------------------------------------------------------------

Another example indicating that the problem occurs also for the {{instanceof}} 
operator.
{code}
def x = [[1]]
assert x instanceof List<List<Integer>>         // passes
def result = x instanceof List<List<Integer>>   // fails
assert result
{code}


was (Author: paulk):
Another example indicating that the problem occurs also for the {{instanceof}} 
operator.
{code}
def x = [[1]]
assert x instanceof List<List<Integer>>         // passes
def result = x instanceof List<List<Integer>>   // fails
assert result
{cpde}

> CompilationError for [[1]] as List<List<Integer>>
> -------------------------------------------------
>
>                 Key: GROOVY-7157
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7157
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.3.7, 2.4.0-beta-3
>            Reporter: Yu Kobayashi
>
> I can run this code,
> {code}
> def list = ([[1]] as List<List<Integer>>)
> println list
> {code}
> but cannot run this code.
> {code}
> def list = [[1]] as List<List<Integer>>
> println list
> {code}
> Error message:
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup 
> failed:
> C:\Users\Yu\Desktop\test.groovy: 2: expecting EOF, found 'println' @ line 2, 
> column 1.
>    println list
>    ^
> {code}



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

Reply via email to