Commits

Chris Lattner committed 6636bafadf8
Fix <rdar://problem/23272739> Poor diagnostic due to contextual constraint Previously we erroneously complained: error: cannot invoke 'contains' with an argument list of type '(String)' now we correctly complain: error: unexpected non-void return value in void function This enhances CSDiags to use "getTypeOfMember" when analyzing method candidates that are applied to a known base type. Using it allows us to substitute information about the base, resolving archetypes that exist in subsequent argument positions. In the testcase, this means that we use information about Set<String> to know that the argument to "contains" is a String. This allows us to generate much better diagnostics in some cases, and works around some limitations in the existing stuff for handling unresolved archetypes. One unfortunate change is the notes in Misc/misc_diagnostics.swift. Because we don't track argument lists very well, we are flattening an argument list that is actually ((Int,Int)) into (Int, Int) so we get a bogus looking diagnostic. This was possible before this patch though, it is just one more case that triggers the issue.