It’s real intent is to check only the generic signature of the DeclContext provided to name lookup, then enclosing contexts. Use it for functions and initializers as well, so we have uniform lookup behavior for entities that can have generic parameters.
A follow-up commit contains some minor, semi-related tweaks along with a pile of updates to the compiler crash testsuite.
Swift SVN r26654
This seems to already be working for variables in trunk, so it's just
functions that need the fix. (I'm not sure why the variables are emitting
the error twice, but I'm not going to spend time on that right now.)
rdar://problem/19715729
Swift SVN r25276