Description
The method pointer operator suppresses checked exceptions and results in a MethodMissingException instead in groovy 4.0.12. This issue seems to first appear in groovy 3.0.16, which is the earliest version I am able to reproduce. Example code
class Foo { static void bar(String str) { throw new IOException() println str } } def baz = Foo.&bar baz('hi')
This results in a MethodMissingException despite the IO Exception being thrown. This seems to be the case for any checked exception.
class Foo { static void bar(String str) { throw new IOException() println str } } Foo.bar("hi")
When calling the method directly I get an IO Exception as expected
Attachments
Issue Links
- is related to
-
GROOVY-10929 Method closure somehow doesn't match argument
-
- Closed
-