[
https://issues.apache.org/jira/browse/GROOVY-6631?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-6631.
-----------------------------
> Static compilation fails around byte arrays
> -------------------------------------------
>
> Key: GROOVY-6631
> URL: https://issues.apache.org/jira/browse/GROOVY-6631
> Project: Groovy
> Issue Type: Bug
> Components: Static compilation
> Affects Versions: 2.3.0, 2.4.0-rc-1
> Reporter: Dimitar Dimitrov
> Assignee: Daniel Sun
> Priority: Major
>
> {code}
> @groovy.transform.CompileStatic
> class Test {
> byte[] parseStructuredString(String s) {
> byte[] data = new byte[s.length() / 2];
> for (int i = 0; i < s.length(); i += 2) {
> data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) +
> Character.digit(s.charAt(i+1), 16));
> }
> return data
> }
> }
> {code}
> Error:(11, 13) Groovyc: [Static type checking] - Cannot find matching method
> [B#getAt(java.math.BigDecimal). Please check if the declared type is right
> and if the method exists.
> Error:(11, 27) Groovyc: [Static type checking] - Cannot assign value of type
> byte to variable of type byte[]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)