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/10 23:00:59 UTC
[GitHub] [groovy] eric-milles opened a new pull request #1515: GROOVY-9807: limit receiver replacement for implicit-this in inner class
eric-milles opened a new pull request #1515:
URL: https://github.com/apache/groovy/pull/1515
When user creates a method call expression, the default is for implicit
this to be true and this has caused a number of problems for transforms
when applied to inner class scenarios. Only when the object expression
is truly "this" should it be rewritten to "Outer.this" when referencing
an outer class method.
https://issues.apache.org/jira/browse/GROOVY-9807
----------------------------------------------------------------
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 pull request #1515: GROOVY-9807: limit receiver replacement for implicit-this in inner class
Posted by GitBox <gi...@apache.org>.
eric-milles commented on pull request #1515:
URL: https://github.com/apache/groovy/pull/1515#issuecomment-797832914
> `GroovyCodeVisitorAdapter` is for specific purpose, so how about making it AIC instead of standalone new class?
What is missing from `GroovyCodeVisitor` and `CodeVisitorSupport` is the ability to override select methods of interest and restrict traversal. If I were to create a straight AIC of `GroovyCodeVisitor` in `InvocationWriter#isThis`, the method would be hundreds of lines long and the number of imports for the class would double. This adapter is useful outside of this particular application -- in fact I imported the implementation from groovy-eclipse.
----------------------------------------------------------------
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 pull request #1515: GROOVY-9807: limit receiver replacement for implicit-this in inner class
Posted by GitBox <gi...@apache.org>.
eric-milles commented on pull request #1515:
URL: https://github.com/apache/groovy/pull/1515#issuecomment-797836052
Any code that uses a sequence of `instanceof` checks to distinguish `ASTNode`/`Expression`/`Statement` types could instead leverage `GroovyCodeVisitorAdapter` and the visitor pattern for type dispatch.
----------------------------------------------------------------
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] danielsun1106 merged pull request #1515: GROOVY-9807: limit receiver replacement for implicit-this in inner class
Posted by GitBox <gi...@apache.org>.
danielsun1106 merged pull request #1515:
URL: https://github.com/apache/groovy/pull/1515
----------------------------------------------------------------
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 edited a comment on pull request #1515: GROOVY-9807: limit receiver replacement for implicit-this in inner class
Posted by GitBox <gi...@apache.org>.
eric-milles edited a comment on pull request #1515:
URL: https://github.com/apache/groovy/pull/1515#issuecomment-797832914
> `GroovyCodeVisitorAdapter` is for specific purpose, so how about making it AIC instead of standalone new class?
What is missing from `GroovyCodeVisitor` and `CodeVisitorSupport` is the ability to override select methods of interest and restrict traversal. If I were to create a straight AIC of `GroovyCodeVisitor` in `InvocationWriter#isThis`, the method would be hundreds of lines long and the number of imports for the class would double. This adapter is useful outside of this particular application -- in fact I imported the implementation from groovy-eclipse.
If `InvocationWriter` was a groovy source, I could use `@AutoImplement` to get the same result. Java requires a more verbose approach, as usual.
----------------------------------------------------------------
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 pull request #1515: GROOVY-9807: limit receiver replacement for implicit-this in inner class
Posted by GitBox <gi...@apache.org>.
paulk-asert commented on pull request #1515:
URL: https://github.com/apache/groovy/pull/1515#issuecomment-800170940
Yep, I am happy with the `GroovyCodeVisitorAdapter` class but if we can think of a better name, I'd also be +1 for that.
----------------------------------------------------------------
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] danielsun1106 commented on pull request #1515: GROOVY-9807: limit receiver replacement for implicit-this in inner class
Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on pull request #1515:
URL: https://github.com/apache/groovy/pull/1515#issuecomment-797776352
GroovyCodeVisitorAdapter is for specific purpose, so how about making it AIC instead of standalone new class?
----------------------------------------------------------------
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] danielsun1106 commented on pull request #1515: GROOVY-9807: limit receiver replacement for implicit-this in inner class
Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on pull request #1515:
URL: https://github.com/apache/groovy/pull/1515#issuecomment-800152169
Merged. Thanks!
----------------------------------------------------------------
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