Byte + Byte, different result than in BlitzMax (legacy)
See this code:
SuperStrict
Framework Brl.StandardIO
Import Brl.Reflection
Local a:Byte = 250
Local b:Byte = 10
Print a+b
Local arr:Object = [a + b]
Print TTypeID.ForObject(arr).Name()
Local i:Int = 255:byte + 1:Byte
Print i
In legacy it prints:
260
Int[]
256
In NG it prints:
260
Byte[]
0
So while NGs behaviour is reasonable it is at least not "backwards compatible". Cannot say if we should be backwards compatible there - or not.
In Legacy any "byte +- byte" becomes an "int" while in NG the result seems to be "preserving" the "biggest primitive type" in the formula.
@HurryStarfish pointed out, that NG differentiates between "ByteVar + ByteVar" (250+10 = 260:Int) and "byteValue + byteValue" (255:Byte + 1:Byte = 0:Byte). So this can at least be seen as bug?
The fact that it differs from legacy BlitzMax certainly makes this a bug, it is a breaking change in behaviour. Bytes/Shorts should be promoted to Ints consistently.
Local a:Byte = 250
Local b:Byte = 10
Print a + b
does output the correct result.