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
Copy file name to clipboardExpand all lines: test/Constraints/mutating_members_compat.swift
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -6,31 +6,31 @@ struct Foo {
6
6
mutatingfunc boom(){}
7
7
}
8
8
9
-
letx=Foo.boom // expected-warning{{partial application of 'mutating' method}}
9
+
letx=Foo.boom // expected-warning{{cannot reference 'mutating' method as function value; calling the function has undefined behavior and will be an error in future Swift versions}}
10
10
vary=Foo()
11
-
letz0= y.boom // expected-error{{partial application of 'mutating' method}}
12
-
letz1=Foo.boom(&y) // expected-error{{partial application of 'mutating' method}}
11
+
letz0= y.boom // expected-error{{cannot reference 'mutating' method as function value}}
12
+
letz1=Foo.boom(&y) // expected-error{{cannot reference 'mutating' method as function value}}
13
13
14
14
func fromLocalContext()->(inoutFoo)->()->(){
15
-
returnFoo.boom // expected-warning{{partial application of 'mutating' method}}
15
+
returnFoo.boom // expected-warning{{cannot reference 'mutating' method as function value; calling the function has undefined behavior and will be an error in future Swift versions}}
return x.boom // expected-error{{partial application of 'mutating' method}}
19
+
return x.boom // expected-error{{cannot reference 'mutating' method as function value}}
20
20
}else{
21
-
returnFoo.boom(&x) // expected-error{{partial application of 'mutating' method}}
21
+
returnFoo.boom(&x) // expected-error{{cannot reference 'mutating' method as function value}}
22
22
}
23
23
}
24
24
25
25
func bar()->P.Type{fatalError()}
26
26
func bar()->Foo.Type{fatalError()}
27
27
28
-
_ =bar().boom // expected-warning{{partial application of 'mutating' method}}
29
-
_ =bar().boom(&y) // expected-error{{partial application of 'mutating' method}}
30
-
_ =bar().boom(&y)() // expected-error{{partial application of 'mutating' method}}
28
+
_ =bar().boom // expected-warning{{cannot reference 'mutating' method as function value; calling the function has undefined behavior and will be an error in future Swift versions}}
29
+
_ =bar().boom(&y) // expected-error{{cannot reference 'mutating' method as function value}}
30
+
_ =bar().boom(&y)() // expected-error{{cannot reference 'mutating' method as function value}}
31
31
32
32
func foo(_ foo:Foo.Type){
33
-
_ = foo.boom // expected-warning{{partial application of 'mutating' method}}
34
-
_ = foo.boom(&y) // expected-error{{partial application of 'mutating' method}}
35
-
_ = foo.boom(&y)() // expected-error{{partial application of 'mutating' method}}
33
+
_ = foo.boom // expected-warning{{cannot reference 'mutating' method as function value; calling the function has undefined behavior and will be an error in future Swift versions}}
34
+
_ = foo.boom(&y) // expected-error{{cannot reference 'mutating' method as function value}}
35
+
_ = foo.boom(&y)() // expected-error{{cannot reference 'mutating' method as function value}}
0 commit comments