Files
swift-mirror/test/Constraints/rdar110617471.swift
Hamish Knight 1616e167b9 [CS] Walk into patterns when looking for closure referenced vars
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
2023-06-12 18:27:24 +01:00

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
}
}
}
}
}