groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniil Ovchinnikov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8264) Setter accessed via getter import alias with setter name
Date Tue, 18 Jul 2017 19:25:00 GMT

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

Daniil Ovchinnikov updated GROOVY-8264:
---------------------------------------
    Summary: Setter accessed via getter import alias with setter name  (was: Setter accessed
via import alias of a getter with setter name)

> Setter accessed via getter import alias with setter name
> --------------------------------------------------------
>
>                 Key: GROOVY-8264
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8264
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.12
>            Reporter: Daniil Ovchinnikov
>
> {code:title=com/foo/Bar.java}package com.foo;
> public class Bar {
>     public static Object getSome() {
>         System.out.println("getter");
>         return 42;
>     }
>     public static void setSome(Object a) {
>         System.out.println("setter " + a);
>     }
> }
> {code}
> {code:title=playground.groovy}
> import static com.foo.Bar.getSome as setAbc
> setAbc() // prints 'getter'
> setAbc(2) // MME: No signature of method: static com.foo.Bar.getSome() is applicable
> abc = 1 // prints 'setter 1', should throw MME
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message