Autodetect visitation return type for unary visitors (refs svn #10837)