You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/09/21 15:56:00 UTC
[jira] [Updated] (GROOVY-8568) SAM coercion doesn't work with
abstract classes in @CompileStatic
[ https://issues.apache.org/jira/browse/GROOVY-8568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-8568:
--------------------------------
Affects Version/s: (was: 2.5.0-rc-1)
> 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
>
> {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.3.4#803005)