groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwagenleitner <...@git.apache.org>
Subject [GitHub] groovy pull request #416: GROOVY-7926 - Don't use a CastExpression if the re...
Date Fri, 09 Sep 2016 15:54:50 GMT
Github user jwagenleitner commented on a diff in the pull request:

    https://github.com/apache/groovy/pull/416#discussion_r78204083
  
    --- Diff: src/main/org/codehaus/groovy/transform/trait/TraitComposer.java ---
    @@ -293,7 +293,8 @@ private static void createForwarderMethod(
     
             ClassNode[] exceptionNodes = correctToGenericsSpecRecurse(genericsSpec, copyExceptions(helperMethod.getExceptions()));
             ClassNode fixedReturnType = correctToGenericsSpecRecurse(genericsSpec, helperMethod.getReturnType());
    -        Expression forwardExpression = genericsSpec.isEmpty()?mce:new CastExpression(fixedReturnType,mce);
    +        boolean noCastRequired = genericsSpec.isEmpty() || fixedReturnType.getName().equals(ClassHelper.VOID_TYPE.getName());
    --- End diff --
    
    Just curious if you saw problems using just `fixedReturnType.equals(ClassHelper.VOID_TYPE)`
that neccessitated comparing by name?  Most places that I see that compare types don't see
to use the getName so am just curious.


---
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.
---

Mime
View raw message