pharo-project / pharo-vm

This is the VM used by Pharo
http://pharo.org
Other
113 stars 68 forks source link

small change in copyWithoutReturn to handle CCoerce #836

Closed RenaudFondeur closed 1 month ago

RenaudFondeur commented 2 months ago

Suppress cCoerce at the top of return expression when we suppress return in inlining.

cCoerce can be found in returns to make them match their method return type. During inlining we can create a copy of parts of the AST without their return. If there is a cCoerce at the top of their expression, it may be no longer needed and can produce a 'warning: expression result unused'.