[
https://issues.apache.org/jira/browse/GROOVY-8154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniil Ovchinnikov updated GROOVY-8154:
---------------------------------------
Description:
Current behaviour:
{code}
assert (String.class)[] == String[].class
{code}
Expected: {{(String.class)[]}} should fail with {{MissingMethodException: No
signature of method: static java.lang.String.getAt() is applicable for argument
types: (ArrayList) values: [[]]}} just like:
{code}
def a = String.class
a[] // MissingMethodException
{code}
was:
Current behaviour:
{code}
assert (String.class)[] == String[].class
{code}
Expected {{(String.class)[]}} should fail with {{MissingMethodException: No
signature of method: static java.lang.String.getAt() is applicable for argument
types: (ArrayList) values: [[]]}} just like:
{code}
def a = String.class
a[] // MissingMethodException
{code}
> Parenthesized class literal with subscript operator
> ---------------------------------------------------
>
> Key: GROOVY-8154
> URL: https://issues.apache.org/jira/browse/GROOVY-8154
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.5.0-alpha-1, 2.4.10
> Reporter: Daniil Ovchinnikov
>
> Current behaviour:
> {code}
> assert (String.class)[] == String[].class
> {code}
> Expected: {{(String.class)[]}} should fail with {{MissingMethodException: No
> signature of method: static java.lang.String.getAt() is applicable for
> argument types: (ArrayList) values: [[]]}} just like:
> {code}
> def a = String.class
> a[] // MissingMethodException
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)