Skip to content

Commit dfa1fda

Browse files
committed
fix warning annotation in test
1 parent 94ef6c4 commit dfa1fda

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/expr/closure/closures.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,19 +790,19 @@ public class TestImplicitSelfForWeakSelfCapture {
790790

791791
doVoidStuffNonEscaping { [weak self] in
792792
let `self`: TestImplicitSelfForWeakSelfCapture? = self ?? TestImplicitSelfForWeakSelfCapture.staticOptional
793-
guard let self = self else { return } // expected-warning {{unexpected warning produced: value 'self' was defined but never used; consider replacing with boolean test}}
793+
guard let self = self else { return } // expected-warning {{value 'self' was defined but never used; consider replacing with boolean test}}
794794
method() // expected-warning {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}}
795795
}
796796

797797
doVoidStuffNonEscaping { [weak self] in
798-
guard let self = self else { return } // expected-warning {{unexpected warning produced: value 'self' was defined but never used; consider replacing with boolean test}}
798+
guard let self = self else { return } // expected-warning {{value 'self' was defined but never used; consider replacing with boolean test}}
799799
doVoidStuff { // expected-note {{capture 'self' explicitly to enable implicit 'self' in this closure}}
800800
method() // expected-error {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}} expected-note {{reference 'self.' explicitly}}
801801
}
802802
}
803803

804804
doVoidStuffNonEscaping { [weak self] in
805-
guard let self = self ?? TestImplicitSelfForWeakSelfCapture.staticOptional else { return } // expected-warning {{unexpected warning produced: value 'self' was defined but never used; consider replacing with boolean test}}
805+
guard let self = self ?? TestImplicitSelfForWeakSelfCapture.staticOptional else { return } // expected-warning {{value 'self' was defined but never used; consider replacing with boolean test}}
806806
method() // expected-warning {{call to method 'method' in closure requires explicit use of 'self' to make capture semantics explicit}}
807807
}
808808
}

0 commit comments

Comments
 (0)