Commits
Joe Groff committed dbd1956d1a2
Sema: Don't bind the tuple label of labeled scalar enum payloads in subpatterns.
In a situation like::
enum Foo {
case Bar(bar: Int)
}
switch foo {
case let .Bar(bar):
use(bar)
}
It's extremely unlikely anyone expects 'bar' to have type '(bar: Int)' rather than 'Int', especially because we try to eliminate single-element tuple types pretty much everywhere else. Put in a hack so that, when we see a paren pattern as the payload subpattern of an enum case pattern, and the payload has a single-element tuple type, we transform the paren pattern into a tuple pattern, which semantically matches off the label. Fixes rdar://problem/18923473, and a lot of dupes.
Swift SVN r25541