[ https://issues.apache.org/jira/browse/GROOVY-9935?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-9935: -------------------------------- Fix Version/s: 2.5.16 > int reference seems to not use its wrapper class > ------------------------------------------------ > > Key: GROOVY-9935 > URL: https://issues.apache.org/jira/browse/GROOVY-9935 > Project: Groovy > Issue Type: Bug > Components: Static compilation, Static Type Checker > Affects Versions: 3.0.7 > Reporter: Stefanos Chaliasos > Assignee: Eric Milles > Priority: Major > Fix For: 3.0.8, 4.0.0-alpha-3, 2.5.16 > > Time Spent: 0.5h > Remaining Estimate: 0h > > I have the following Groovy program > > {code:groovy} > @groovy.transform.TypeChecked > class Foo { > static Number foo() { > def i = 10 // If I use: `Integer i = 10` it works > return i > } > } > {code} > h2. Actual Behavior > The program does not compile, and I get the following error. > {code:java} > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > Test.groovy: 5: [Static type checking] - Cannot return value of type int on > method returning type java.lang.Number > @ line 5, column 12. > return i > ^ > 1 error > {code} > h2. Expected Behavior > Compile successfully. -- This message was sent by Atlassian Jira (v8.20.1#820001)