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

Paul King closed GROOVY-8568.
-----------------------------

> SAM  coercion doesn't work with abstract classes in @CompileStatic
> ------------------------------------------------------------------
>
>                 Key: GROOVY-8568
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8568
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation, Static Type Checker
>    Affects Versions: 2.4.13
>            Reporter: Alexey Afanasiev
>            Priority: Major
>             Fix For: 2.5.0
>
>
> {code:java}
> import groovy.transform.CompileStatic
> abstract class A1 {
>     def abstract foo()
> }
> @CompileStatic
> def m() {
>     A1 a = { print this } //Groovyc: [Static type checking] - Cannot assign 
> value of type groovy.lang.Closure <java.lang.Void> to variable of type A1
> }
> {code}
> Looks like it should work as in dynamic mode.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to