This appears to be related to the "SetLastValue" and "GetValue" calls in AbstractInterpreter.
---------------------------------------
C:\tools\boo\bin>booish --print-modules
Welcome to booish, an interpreter for the boo programming language.
Running boo 0.6.0.1858.
The following builtin functions are available:
dir(Type): lists the members of a type
help(Type): prints detailed information about a type
load(string): evals an external boo file
globals(): returns the names of all variables known to the interpreter
Enter boo code in the prompt below.
>>> i as short = short.MaxValue
[Boo.Lang.ModuleAttribute]
public final transient class Input1Module(System.Object):
private static def Main(argv as (System.String)) as System.Void:
Input1Module.ParentInterpreter.SetLastValue(Input1Module.ParentInterpreter.SetValue('i', short.MaxValue)
)
private def constructor():
super()
public static ParentInterpreter as Boo.Lang.Interpreter.AbstractInterpreter
32767
>>> i += 45
[Boo.Lang.ModuleAttribute]
public final transient class Input3Module(System.Object):
private static def Main(argv as (System.String)) as System.Void:
Input3Module.ParentInterpreter.SetLastValue(Input3Module.ParentInterpreter.SetValue('i', (cast(System.In
t16, Input3Module.ParentInterpreter.GetValue('i')) + 45)))
private def constructor():
super()
public static ParentInterpreter as Boo.Lang.Interpreter.AbstractInterpreter
32812
>>> i
[Boo.Lang.ModuleAttribute]
public final transient class Input4Module(System.Object):
private static def Main(argv as (System.String)) as System.Void:
Input4Module.ParentInterpreter.SetLastValue(Input4Module.ParentInterpreter.GetValue('i'))
private def constructor():
super()
public static ParentInterpreter as Boo.Lang.Interpreter.AbstractInterpreter
32812
>>>
---------------------------------------
No type or range checking appears to be taking place. Also, the intrinsic value for integral types appears to be Int32... Compare the behavior of int to short (above):
>>> j as int
[Boo.Lang.ModuleAttribute]
public final transient class Input5Module(System.Object):
private static def Main(argv as (System.String)) as System.Void:
pass
private def constructor():
super()
public static ParentInterpreter as Boo.Lang.Interpreter.AbstractInterpreter
>>> j = int.MaxValue
[Boo.Lang.ModuleAttribute]
public final transient class Input6Module(System.Object):
private static def Main(argv as (System.String)) as System.Void:
Input6Module.ParentInterpreter.SetLastValue(Input6Module.ParentInterpreter.SetValue('j', int.MaxValue))
private def constructor():
super()
public static ParentInterpreter as Boo.Lang.Interpreter.AbstractInterpreter
2147483647
>>> j += 1
[Boo.Lang.ModuleAttribute]
public final transient class Input7Module(System.Object):
private static def Main(argv as (System.String)) as System.Void:
Input7Module.ParentInterpreter.SetLastValue(Input7Module.ParentInterpreter.SetValue('j', (cast(System.In
t32, Input7Module.ParentInterpreter.GetValue('j')) + 1)))
private def constructor():
super()
public static ParentInterpreter as Boo.Lang.Interpreter.AbstractInterpreter
System.OverflowException: Arithmetic operation resulted in an overflow.
at Input7Module.Main(String[] argv)
>>>
Make that "The first 'i += 1' call should trigger an overflow error.