You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2021/03/11 18:53:44 UTC

[GitHub] [groovy] eric-milles opened a new pull request #1517: GROOVY-9977: share logic for functional interface assignment

eric-milles opened a new pull request #1517:
URL: https://github.com/apache/groovy/pull/1517


   https://issues.apache.org/jira/browse/GROOVY-9977


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [groovy] eric-milles merged pull request #1517: GROOVY-9977: share logic for functional interface assignment

Posted by GitBox <gi...@apache.org>.
eric-milles merged pull request #1517:
URL: https://github.com/apache/groovy/pull/1517


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [groovy] paulk-asert commented on a change in pull request #1517: GROOVY-9977: share logic for functional interface assignment

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on a change in pull request #1517:
URL: https://github.com/apache/groovy/pull/1517#discussion_r594131392



##########
File path: src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
##########
@@ -1834,19 +1838,22 @@ public void visitField(final FieldNode node) {
         try {
             typeCheckingContext.isInStaticContext = node.isInStaticContext();
             currentField = node;
-            super.visitField(node);
+            visitAnnotations(node);

Review comment:
       Normal visitor pattern would call super here. Perhaps a comment here to indicate that were replicating some of super.visitField to avoid processing init expression twice?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [groovy] eric-milles commented on a change in pull request #1517: GROOVY-9977: share logic for functional interface assignment

Posted by GitBox <gi...@apache.org>.
eric-milles commented on a change in pull request #1517:
URL: https://github.com/apache/groovy/pull/1517#discussion_r594637443



##########
File path: src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
##########
@@ -1834,19 +1838,22 @@ public void visitField(final FieldNode node) {
         try {
             typeCheckingContext.isInStaticContext = node.isInStaticContext();
             currentField = node;
-            super.visitField(node);
+            visitAnnotations(node);

Review comment:
       If changed back, there are test cases that will fail.  It is technically possible to structure this so that the functional interface stuff comes before "super.visitField(node)" and the assignment type checking comes after (where it currently sits).
   
   The property visit could have its initialization expression visit dropped, since it is redundant with the field.  I thought that would be a riskier change to make.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [groovy] paulk-asert commented on a change in pull request #1517: GROOVY-9977: share logic for functional interface assignment

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on a change in pull request #1517:
URL: https://github.com/apache/groovy/pull/1517#discussion_r594131520



##########
File path: src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
##########
@@ -1821,7 +1823,9 @@ public void visitProperty(final PropertyNode node) {
         try {
             typeCheckingContext.isInStaticContext = node.isInStaticContext();
             currentProperty = node;
-            super.visitProperty(node);
+            visitAnnotations(node);

Review comment:
       ditto with my other comment?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org