LOOM-1779: Error nicely when declaring a variable or function outside of...

... class scope