You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "John Wagenleitner (JIRA)" <ji...@apache.org> on 2018/05/17 18:22:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16479505#comment-16479505 ]
John Wagenleitner commented on GROOVY-8568:
-------------------------------------------
I'm not able to reproduce the error with 2.5.0-rc-1 or rc-2 or 2.4.13 with the given code sample.
> 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, 2.5.0-rc-1
> 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
(v7.6.3#76005)