groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Wagenleitner (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8568) SAM coercion doesn't work with abstract classes in @CompileStatic
Date Thu, 17 May 2018 18:22:00 GMT

    [ 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)

Mime
View raw message