inferVariableDeclaration

This infers a VariableDeclaration based on an unresolved Reference, which is supplied as a hint. Currently, this is only used to infer global variables. In the future, we might also infer static variables in namespaces.