You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (JIRA)" <ji...@apache.org> on 2017/07/18 19:25:00 UTC
[jira] [Updated] (GROOVY-8264) Setter accessed via getter import
alias with setter name
[ 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)