[ConstraintSystem] Ignore patterns in linked expression analysis (#18487)

Fixes an assertion hit in "pattern in binary expression" case.

rdar://problem/41071587
This commit is contained in:
Rintaro Ishizaki
2018-08-04 11:26:09 +09:00
committed by GitHub
parent 913f3710c6
commit d86725cf80
3 changed files with 30 additions and 0 deletions

View File

@@ -286,6 +286,10 @@ case (_, var e, 3) +++ (1, 2, 3):
// expected-error@-1{{'_' can only appear in a pattern}}
// expected-error@-2{{'var' binding pattern cannot appear in an expression}}
()
case (let (_, _, _)) + 1:
// expected-error@-1 2 {{'var' binding pattern cannot appear in an expression}}
// expected-error@-2 {{expression pattern of type 'Int' cannot match values of type '(Int, Int, Int)'}}
()
}
// FIXME: We don't currently allow subpatterns for "isa" patterns that