Good find!
Unfortunately, there is a reason why we don’t let you declare a global var
: we’re not done implementing global variables, and want to reserve the right to change their behavior without breaking everybody’s code, so for now we disallow them.
We recently discovered this particular loophole ourselves, and are in the process of closing it. I recommend against using it in the meantime, as once we close the loophole, your code won’t compile.
For now, you only have round-scoped variables on device classes.