bcc icon indicating copy to clipboard operation
bcc copied to clipboard

Suggestion: add (optional?) compile warnings for casted return values

Open GWRon opened this issue 3 years ago • 3 comments

Function MyCustomCompareFunction:Int(o1:Object, o2:Object)
  Return TMy(o1).longValue - TMy(o2).longValue
End Function

If you are not aware of "longValue" being of type long (eg by refactoring from int to long) this issue might sneek in unseen. (the issue in this case is a potential "roll over" if the difference is bigger or smaller than the integer limits)

So maybe optionally inform the developer via a "warning", that you cast unseen (here from long to int).

GWRon avatar Jul 08 '21 07:07 GWRon