You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sema: Don't generate OneWayEqual constraints for pattern bindings
I had to revert #78301 to fix
rdar://143338891.
This now brings back the change, but without deleting code; instead,
it's guarded by the -disable-optimized-restrictions flag. Once the
flag is removed, I will once again completely delete OneWayEqual
constraints.
Copy file name to clipboardExpand all lines: test/expr/closure/closures_swift6.swift
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -501,14 +501,18 @@ class TestGithubIssue70089 {
501
501
}
502
502
503
503
doVoidStuff{[weak self]in
504
-
doVoidStuff{[self]in
505
-
x +=1 // expected-error {{explicit use of 'self' is required when 'self' is optional, to make control flow explicit}} expected-note{{reference 'self?.' explicitly}}
504
+
doVoidStuff{[self]in // expected-error {{value of optional type 'TestGithubIssue70089?' must be unwrapped to a value of type 'TestGithubIssue70089'}}
505
+
// expected-note@-1 {{coalesce using '??' to provide a default when the optional value contains 'nil'}}
506
+
// expected-note@-2 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
507
+
x +=1
506
508
}
507
509
}
508
510
509
511
doVoidStuff{[weak self]in
510
-
doVoidStuff{[self]in
511
-
self.x +=1 // expected-error {{value of optional type 'TestGithubIssue70089?' must be unwrapped to refer to member 'x' of wrapped base type 'TestGithubIssue70089'}} expected-note {{chain the optional using '?' to access member 'x' only for non-'nil' base values}} expected-note{{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
512
+
doVoidStuff{[self]in // expected-error {{value of optional type 'TestGithubIssue70089?' must be unwrapped to a value of type 'TestGithubIssue70089'}}
513
+
// expected-note@-1 {{coalesce using '??' to provide a default when the optional value contains 'nil'}}
514
+
// expected-note@-2 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
0 commit comments