public void CallParse() { BadTryParse btp = null; BadTryParse.TryParse(String.Empty, out btp); BadTryParse.TryParse('a', out btp); BadTryParse.TryParse(String.Empty, btp); // below is valid since there was no valid TryParse cnadidate BadTryParse.Parse(null); }
// bad candidate - first parameter is not 'string' static bool TryParse(char c, out BadTryParse btp) { btp = new BadTryParse(); return(true); }
// bad candidate - last parameter is not 'out <type>' static bool TryParse(string s, BadTryParse btp) { btp = new BadTryParse(); return(true); }
// bad candidate - does not return 'bool' static void TryParse(string s, out BadTryParse btp) { btp = new BadTryParse(); }