[ 
https://issues.apache.org/jira/browse/GROOVY-8244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles updated GROOVY-8244:
--------------------------------
    Fix Version/s:     (was: 5.0.0-alpha-1)

> SAM trait coercion with default parameters
> ------------------------------------------
>
>                 Key: GROOVY-8244
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8244
>             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
>
>
> {code}
> trait T {
>     abstract def foo(a, b = 1)
> }
> T t = { o1, o2 ->
>     println o1
>     assert o2 == 1
> }
> t.foo(42) // Caught: groovy.lang.MissingMethodException: No signature of 
> method: abstractMethod$_run_closure1.doCall() is applicable for argument 
> types: (java.lang.Integer) values: [42]
> {code}
> Expected result: it should just work or throw GroovyCastException in case of 
> traits are not SAM candidates



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to