gizmo icon indicating copy to clipboard operation
gizmo copied to clipboard

Improve generated bytecode for Switch constructs with fall through disabled if the case block returns a value

Open mkouba opened this issue 1 year ago • 1 comments

Currently, the generated bytecode contains some garbage as described in https://github.com/quarkusio/quarkus/pull/36626#discussion_r1370141899.

We could try to detect that the case block ends with a return operation and do not break the scope.

mkouba avatar Oct 24 '23 13:10 mkouba

This is a very naive approach (javac seems to do a much more involved control flow analysis), but it should be good enough for a decent number of cases, so +1.

Ladicek avatar Oct 24 '23 13:10 Ladicek