Fix crashes when a variable is accessed by nested function inside __traits(compile) or typeof