File tree Expand file tree Collapse file tree 4 files changed +64
-5
lines changed Expand file tree Collapse file tree 4 files changed +64
-5
lines changed Original file line number Diff line number Diff line change @@ -2949,10 +2949,6 @@ namespace {
29492949 PreWalkAction walkToDeclPre (Decl *D) override {
29502950 return Action::VisitChildrenIf (isa<PatternBindingDecl>(D));
29512951 }
2952-
2953- PreWalkResult<Pattern *> walkToPatternPre (Pattern *P) override {
2954- return Action::SkipChildren (P);
2955- }
29562952 } collectVarRefs (CS);
29572953
29582954 // Walk the capture list if this closure has one, because it could
Original file line number Diff line number Diff line change @@ -2625,8 +2625,10 @@ void ConjunctionElement::findReferencedVariables(
26252625 }
26262626
26272627 if (element.is <Decl *>() || element.is <StmtConditionElement *>() ||
2628- element.is <Expr *>() || element.isStmt (StmtKind::Return))
2628+ element.is <Expr *>() || element.isPattern (PatternKind::Expr) ||
2629+ element.isStmt (StmtKind::Return)) {
26292630 element.walk (refFinder);
2631+ }
26302632}
26312633
26322634Type constraints::isPlaceholderVar (PatternBindingDecl *PB) {
Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift
2+
3+ // https://github.com/apple/swift/issues/66561
4+
5+ @propertyWrapper
6+ struct WrapperValue < Value> {
7+ var value : Value
8+ init ( wrappedValue: Value ) {
9+ self . value = wrappedValue
10+ }
11+
12+ var projectedValue : Self {
13+ return self
14+ }
15+
16+ var wrappedValue : Value {
17+ get {
18+ self . value
19+ }
20+ set {
21+ self . value = newValue
22+ }
23+ }
24+ }
25+
26+ func test( ) {
27+ let _ = {
28+ @WrapperValue var value : Bool = false
29+ switch value {
30+ case $value. wrappedValue:
31+ break
32+ default :
33+ break
34+ }
35+ }
36+ }
Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift
2+
3+ // rdar://110617471: Make sure we can type-check this.
4+ class C {
5+ var prop = 0
6+ }
7+
8+ func foo( _ fn: ( ) -> Void ) { }
9+
10+ class D {
11+ let c = C ( )
12+
13+ func bar( ) {
14+ foo { [ c] in
15+ foo {
16+ switch 0 {
17+ case c. prop:
18+ break
19+ default :
20+ break
21+ }
22+ }
23+ }
24+ }
25+ }
You can’t perform that action at this time.
0 commit comments