Thanks for reporting this. I’ve reproduced it and it’s fixed for the next release: https://feedback.objo.dev/bug/351
The crash wasn’t actually specific to ScrollBox. The root cause was that this:
Var yOffset As Double = 200
was accepted by the compiler as an Integer -> Double widening conversion, but the emitted runtime value was still an Integer. So this later call:
yOffset.ToInteger()
was being dispatched as though it were Integer.ToInteger() rather than Double.ToInteger(), which produced the misleading runtime error.
The fix now emits the required runtime widening cast, and I’ve added regression tests for the original ScrollBox.ContentHeight case and the wider numeric conversion paths.
In the meantime, these workarounds are safe until the next release comes out:
Var yOffset As Double = 200.0
or:
Var yOffset As Double = Double(200)
or:
Var yOffset As Double = 200.ToDouble()