well-formedness of methods and anonymous functions checks