[
https://issues.apache.org/jira/browse/GROOVY-7748?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
John Wagenleitner resolved GROOVY-7748.
---------------------------------------
Resolution: Fixed
Fix Version/s: 2.4.8
Verified that this issue was fixed in GROOVY-7927 by commit
[776ea2cdfd2aa0|https://github.com/apache/groovy/commit/776ea2cdfd2aa0ba1525354f62f1f49faa920ff4].
The test added for that commit looks like it sufficiently covers this issue.
Thanks for reporting.
> SAM & @CompileStatic failure
> ----------------------------
>
> Key: GROOVY-7748
> URL: https://issues.apache.org/jira/browse/GROOVY-7748
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Maxim Medvedev
> Fix For: 2.4.8
>
>
> Groovyc fails to compile SAM coercion used in variable declaration
> {code}
> interface Function<D, I> {
> I fun(D dom)
> }
> class A{}; class B{}
> @CompileStatic
> void sample() {
> Function<A, B> f = {A dom -> return new B() } //compilation fails here
> }
> void bar(Function<A, B> fun) {}
> @CompileStatic
> void sample2() {
> bar {A dom -> return new B() } //compiles & runs ok
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)