[
https://issues.apache.org/jira/browse/GROOVY-10603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-10603.
----------------------------------
Fix Version/s: 5.0.0-alpha-1
Resolution: Fixed
https://github.com/apache/groovy/commit/b66abe42b56b7e3e3b48cdd442fbcdf9ea247e8b
> LUP operation returns incorrect result
> --------------------------------------
>
> Key: GROOVY-10603
> URL: https://issues.apache.org/jira/browse/GROOVY-10603
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Thodoris Sotiropoulos
> Priority: Major
> Fix For: 5.0.0-alpha-1
>
>
> I have the following program
> {code}
> interface Foo {}
> class Bar implements Foo {}
> interface Baz extends Foo {}
> class Qux implements Baz {}
> class Test {
> public static Foo test() {
> Qux x = new Qux();
> return (true) ? x : (Bar) null;
>
> }
>
> }
> {code}
> h3. Actual behaviour
> {code}
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed:
> test.groovy: 13: [Static type checking] - Cannot return value of type
> groovy.lang.GroovyObject for method returning Foo
> @ line 13, column 12.
> return (true) ? x : (Bar) null;
> ^
> 1 error
> {code}
> h3. Expected behaviour
> Compile successfully
> Tested against master (commit: 5c468cd352f37fb5c599a3f51534ffcc55b339ed)
--
This message was sent by Atlassian Jira
(v8.20.7#820007)