Closed matic277 closed 3 months ago
Thank you for reporting this. I think this is a duplicate of https://github.com/openclover/clover/issues/237, in which I fixed two problems - the "final" keyword in instanceof and the "<?>" generic signature. This is implemented but waiting for next release, 4.6.0.
Instrumentation produces invalid Java code, if generics are used in instanceof pattern matching. Example:
Produces:
Note how clover adds more conditions to the second if-statement, which uses generics <?> on instanceof matching. Which I assume put the variable "g" out of scope in the else block.
Using Java 17 with OpenClover 4.5.2