what you've posted will totally work. You can't declare types as global, they are global by definition! The instances of the types you have made, c and p, are declared as global so the test you have made is totally fine unless the test occurs in a function and you have overriden p and c with some new local definitions, which would be a bit dumb.