[ 
https://issues.apache.org/jira/browse/GROOVY-9769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King resolved GROOVY-9769.
-------------------------------
    Fix Version/s: 4.0.0-alpha-2
                   3.0.7
       Resolution: Fixed

Merged, thanks. I don't believe there is anywhere where we are relying on the 
redundant interfaces. Hopefully no downstream projects do.

> STC: UnionTypeClassNode created for simple instanceof scenarios
> ---------------------------------------------------------------
>
>                 Key: GROOVY-9769
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9769
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 3.0.7, 4.0.0-alpha-2
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Consider the following:
> {code:groovy}
> interface A {
>   def foo() {}
> }
> interface B extends A {
>   def bar() {}
> }
> @groovy.transform.CompileStatic
> void test(A a) {
>   if (a instanceof B) {
>     a.foo()
>     a.bar()
>   }
> }
> {code}
> Variable expression "a" infers to "<UnionType:A+B>" due to {{instanceof}} 
> screening.  Since B extends A, a simple ClassNode for B should be sufficient.
> The union types are harder to deal with for consumers.  This is a variant of 
> GROOVY-7333.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to