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 2020/07/21 13:22:46 UTC

[GitHub] [groovy] paulk-asert opened a new pull request #1321: GROOVY-9648: Bad error message when attempting to call a missing cons…

paulk-asert opened a new pull request #1321:
URL: https://github.com/apache/groovy/pull/1321


   …tructor with named args


----------------------------------------------------------------
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 closed pull request #1321: GROOVY-9648: Bad error message when attempting to call a missing cons…

Posted by GitBox <gi...@apache.org>.
paulk-asert closed pull request #1321:
URL: https://github.com/apache/groovy/pull/1321


   


----------------------------------------------------------------
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 #1321: GROOVY-9648: Bad error message when attempting to call a missing cons…

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on pull request #1321:
URL: https://github.com/apache/groovy/pull/1321#issuecomment-662149467


   > It would be better to have a test to show the improved error message.
   
   Yes, I plan to add a testcase. I just hadn't decided the best one to add. The example I had in the issue completes "successfully" via the MOP path which is then taken. It supplies a null in the constructor and then coerces the Date to a String for the subsequent setter call. If you swap from a String property to something with no coercion you then get a GroovyCastException which I think is okay. To get the same kind of "failed to invoke constructor" message, we'd need to throw the exception instead of return null in the code which would rule out some MOP tricks like the coercion.


----------------------------------------------------------------
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 #1321: GROOVY-9648: Bad error message when attempting to call a missing cons…

Posted by GitBox <gi...@apache.org>.
paulk-asert commented on pull request #1321:
URL: https://github.com/apache/groovy/pull/1321#issuecomment-663497524


   Merged.


----------------------------------------------------------------
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 #1321: GROOVY-9648: Bad error message when attempting to call a missing cons…

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on pull request #1321:
URL: https://github.com/apache/groovy/pull/1321#issuecomment-662237433


   Also, we could use lambda to avoid duplicated code:
   
   ```java
   BiPredicate<Object, Integer> bp = (res, cnt) -> {
      res instanceof CachedConstructor && ((CachedConstructor)res).getParameterTypes().length == cnt
   }
   
   if (bp.test(res, 1)) return null;
       ...
   if (bp.test(res, 2)) return null;
   ```


----------------------------------------------------------------
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 #1321: GROOVY-9648: Bad error message when attempting to call a missing cons…

Posted by GitBox <gi...@apache.org>.
danielsun1106 commented on pull request #1321:
URL: https://github.com/apache/groovy/pull/1321#issuecomment-661996400


   It would be better to have a test to show the improved  error message.
   


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