Thibault Kruse
2015-03-02 14:32:20 UTC
Hi,
using groovy 2.4.1 (and earlier), I faced several weird / invalid
errors, some related to IntelliJ, some in Groovy.
At least this one seems to be by Groovy:
class TestGenerics {
static <T> List<T> randomSample(T[] sequence, String a) {
return Arrays.asList(sequence)[0..1]
}
static void main(String[] args) {
List val = randomSample([1, 2, 3] as int[], '1')
}
}
kruset:/tmp $ groovy TestGenerics.groovy
Caught: groovy.lang.MissingMethodException: No signature of method:
static TestGenerics.randomSample() is applicable for argument types:
([I, java.lang.String) values: [[1, 2, 3], 1]
If I remove the superfluous String argument, it works fine.
Sadly the IntelliJ groovy parser seems to be independent of the used
groovyc version, so the visible editor output does not always match
what a given groovyc version will accept.
Should I open a JIRA ticket?
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
using groovy 2.4.1 (and earlier), I faced several weird / invalid
errors, some related to IntelliJ, some in Groovy.
At least this one seems to be by Groovy:
class TestGenerics {
static <T> List<T> randomSample(T[] sequence, String a) {
return Arrays.asList(sequence)[0..1]
}
static void main(String[] args) {
List val = randomSample([1, 2, 3] as int[], '1')
}
}
kruset:/tmp $ groovy TestGenerics.groovy
Caught: groovy.lang.MissingMethodException: No signature of method:
static TestGenerics.randomSample() is applicable for argument types:
([I, java.lang.String) values: [[1, 2, 3], 1]
If I remove the superfluous String argument, it works fine.
Sadly the IntelliJ groovy parser seems to be independent of the used
groovyc version, so the visible editor output does not always match
what a given groovyc version will accept.
Should I open a JIRA ticket?
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email