Unify the duplicate pattern var checking in
pattern resolution such that it is always called
no matter how we end up type-checking the pattern.
This avoids incorrectly allowing duplicate pattern
vars to compile for patterns as a part of
multi-statement closures.
The parser's own re-declaration checking for local declarations has
slightly different behavior than Sema's re-declaration check.
Whereas Sema rejects this:
class C {
let x = 123
func x() {}
}
The parser accepts this:
func f() {
let x = 123
func x() {}
}
With Sema's check now handling both cases, fudge the behavior to
match the parser in the local case.