Improve type_enclosing: hide syntax errors, filter duplicate results