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 2022/10/12 18:32:00 UTC
[jira] [Updated] (GROOVY-8243) SAM trait coercion via middle interface
[ https://issues.apache.org/jira/browse/GROOVY-8243?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-8243:
--------------------------------
Fix Version/s: 2.5.19
> SAM trait coercion via middle interface
> ---------------------------------------
>
> Key: GROOVY-8243
> URL: https://issues.apache.org/jira/browse/GROOVY-8243
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.10
> Reporter: Daniil Ovchinnikov
> Assignee: Eric Milles
> Priority: Major
> Labels: trait, traits
> Fix For: 3.0.11, 4.0.2, 2.5.19
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> {code}
> trait T {
> abstract def foo(int i)
> def bar(double j) {
> println "bar $j"
> }
> }
> interface F extends T {}
> F t = { println "closure $it" }
> t.foo(42) // `closure 42`
> t.bar(43) // `closure 43.0`; should be `bar 43.0`
> {code}
> Changing variable type to {{T}} works as expected.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)