bcc
bcc copied to clipboard
Suggestion: add (optional?) compile warnings for casted return values
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).