Closed IsaacOscar closed 5 years ago
This is deliberate — its an optimisation to make simple accessors reasonably fast. Maybe this is misguided?
Commit d2ae13d restricts this optimization to methods that don't have parameters (and are not once methods). There is now a test for this case in t020 test case "once methods and accessor methods".
Consideer this code:
Runing this through
mgc
causes no runtime errors. However if I changefoo
's body to{done; x}
. I get runtime errors as expected.Note this happens whenever the method body is a single variable name (even if not a method paramater), and effects both paramater and return type checks.