You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by shils <gi...@git.apache.org> on 2016/10/04 21:15:43 UTC

[GitHub] groovy pull request #436: GROOVY-7952: Property expressions for extension me...

GitHub user shils opened a pull request:

    https://github.com/apache/groovy/pull/436

    GROOVY-7952: Property expressions for extension methods starting with\u2026

    \u2026 'is' fail STC
    
    * Add support for 'is' getter method variants of GROOVY-5580

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/shils/groovy GROOVY-7952

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/groovy/pull/436.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #436
    
----
commit 2904683fad2429c457b3c40c302b9d5e7956810b
Author: Shil Sinha <sh...@gmail.com>
Date:   2016-10-04T21:08:20Z

    GROOVY-7952: Property expressions for extension methods starting with 'is' fail STC
    * Add support for 'is' getter method variants of GROOVY-5580

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #436: GROOVY-7952: Property expressions for extension me...

Posted by paulk-asert <gi...@git.apache.org>.
Github user paulk-asert commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/436#discussion_r82111762
  
    --- Diff: src/main/org/codehaus/groovy/classgen/asm/sc/StaticTypesCallSiteWriter.java ---
    @@ -158,19 +158,24 @@ public void makeGetPropertySite(Expression receiver, final String methodName, fi
     
             // GROOVY-5580, it is still possible that we're calling a superinterface property
             String getterName = "get" + MetaClassHelper.capitalize(methodName);
    +        String altGetterName = "is" + MetaClassHelper.capitalize(methodName);
             if (receiverType.isInterface()) {
                 Set<ClassNode> allInterfaces = receiverType.getAllInterfaces();
                 MethodNode getterMethod = null;
                 for (ClassNode anInterface : allInterfaces) {
                     getterMethod = anInterface.getGetterMethod(getterName);
    -                if (getterMethod!=null) break;
    +                if (getterMethod == null) getterMethod = anInterface.getGetterMethod(altGetterName);
    +                if (getterMethod != null) break;
                 }
                 // GROOVY-5585
    -            if (getterMethod==null) {
    +            if (getterMethod == null) {
                     getterMethod = OBJECT_TYPE.getGetterMethod(getterName);
                 }
    +            if (getterMethod == null) {
    +                getterMethod = OBJECT_TYPE.getGetterMethod(altGetterName);
    --- End diff --
    
    There are no isXxx methods in Object? Is this needed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] groovy pull request #436: GROOVY-7952: Property expressions for extension me...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/groovy/pull/436


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---