The client vars eye and virtual_eye aren't defined as of /atom type, even though they can only ever contain atoms. They should be properly defined as of their general type, like other similar vars (f.ex. loc), so typecasting isn't needed to access /atom properties from them.
Code Snippet (if applicable) to Reproduce Problem:
(Also, the DM tag in bug reports produces a ton of whitespace out of nowhere. I put no extra newlines inside the DM tag in my post. I think this used to work fine...)
The code compiles fine as the compiler is aware that eye should contain an /atom, and /atom has a 'name' var.
The compiler blurts an undefined var error because you try to access 'name'.