Report boxed math warning on function that boxes primitive return value
Description
With the new :warn-on-boxed (CLJ-1325), these examples do not report a boxed math warning although they each do boxing:
Cause: emitBoxReturn has a hard-coded call to box a prim return value.
Solution: If *unchecked-math* is set to :warn-on-boxed, emit a warning on boxing of primitive numeric return types.
Patch:
Environment
None
Attachments
1
Activity
Show:
Alex Miller November 12, 2014 at 6:39 AM
Attached patch does the job, but from trying it out on some real code, it finds both problematic cases and lots of cases that could safely be ignored and/or where there is no obvious way to fix the warning. I think it may need some more tuning to reduce the rate of unfixable things a bit.
With the new :warn-on-boxed (CLJ-1325), these examples do not report a boxed math warning although they each do boxing:
Cause: emitBoxReturn has a hard-coded call to box a prim return value.
Solution: If *unchecked-math* is set to :warn-on-boxed, emit a warning on boxing of primitive numeric return types.
Patch: