mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Previously we would skip over ExprPatterns, but we need to ensure that we walk them, as they may have interesting variable references that the closure needs to be connected to the type variables for. rdar://110617471
26 lines
342 B
Swift
26 lines
342 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
// rdar://110617471: Make sure we can type-check this.
|
|
class C {
|
|
var prop = 0
|
|
}
|
|
|
|
func foo(_ fn: () -> Void) {}
|
|
|
|
class D {
|
|
let c = C()
|
|
|
|
func bar() {
|
|
foo { [c] in
|
|
foo {
|
|
switch 0 {
|
|
case c.prop:
|
|
break
|
|
default:
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|