You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2020/08/09 02:10:00 UTC

[jira] [Updated] (GROOVY-9673) GroovyCastException when using Trait.super.name = ... with multiple setters

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

Daniel Sun updated GROOVY-9673:
-------------------------------
    Fix Version/s:     (was: 3.0.6)

> GroovyCastException when using Trait.super.name = ... with multiple setters
> ---------------------------------------------------------------------------
>
>                 Key: GROOVY-9673
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9673
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-alpha-1
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Consider the following:
> {code:groovy}trait T {
>   def setX(Number n) {
>     println 'Number'
>   }
>   def setX(String s) {
>     println 'String'
>   }
> }
> class C implements T {
>   void test() {
>     T.super.x = 'x'
>   }
> }
> new C().test()
> {code}
> "T.super.x = 'x'" should drive {{setX(String)}} but instead targets the Number overload and fails with GroovyCastException.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)