Thanks Thomas, much appreciated.
Just for completeness, the code from which this was cut down actually calls functions in the Vega Javascript library: I switched to `js.Math.random` for the example to avoid the need to import Vega (the dangers of over simplifying!).
Is there any good documentation on this? One of the things I did try was `^number` and got the same warning, and I wasn't aware of the difference, or the fact that type hints won't work for macros?
Thanks again!