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
takesMutablePointer(&f) // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<Int>'}}
28
+
takesMutablePointer(&f) // expected-error{{cannot convert value of type 'Float' to expected argument type 'Int'}}
29
29
takesMutablePointer(i) // expected-error{{cannot convert value of type 'Int' to expected argument type 'UnsafeMutablePointer<Int>'}}
30
30
takesMutablePointer(f) // expected-error{{cannot convert value of type 'Float' to expected argument type 'UnsafeMutablePointer<Int>'}}
31
31
varii:[Int]=[0,1,2]
32
32
varff:[Float]=[0,1,2]
33
33
takesMutablePointer(&ii)
34
-
takesMutablePointer(&ff) // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<Int>'}}
34
+
takesMutablePointer(&ff) // expected-error{{cannot convert value of type '[Float]' to expected argument type 'Int'}}
35
35
takesMutablePointer(ii) // expected-error{{cannot convert value of type '[Int]' to expected argument type 'UnsafeMutablePointer<Int>'}}
36
36
takesMutablePointer(ff) // expected-error{{cannot convert value of type '[Float]' to expected argument type 'UnsafeMutablePointer<Int>'}}
37
37
38
-
takesMutableArrayPointer(&i) // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<[Int]>' (aka 'UnsafeMutablePointer<Array<Int>>')}}
38
+
takesMutableArrayPointer(&i) // expected-error{{cannot convert value of type 'Int' to expected argument type '[Int]'}}
39
39
takesMutableArrayPointer(&ii)
40
40
41
41
// We don't allow these conversions outside of function arguments.
42
-
varx:UnsafeMutablePointer<Int>=&i // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<Int>'}}
43
-
x =&ii // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<Int>'}}
42
+
varx:UnsafeMutablePointer<Int>=&i // expected-error{{cannot pass immutable value of type 'Int' as inout argument}}
43
+
x =&ii // expected-error{{cannot assign value of type '[Int]' to type 'Int'}}
takesMutableVoidPointer(ff) // expected-error{{cannot convert value of type '[Int]' to expected argument type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>')}}
70
70
71
71
// We don't allow these conversions outside of function arguments.
72
-
varx:UnsafeMutablePointer<Void>=&i // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>')}}
72
+
varx:UnsafeMutablePointer<Void>=&i // expected-error{{cannot convert value of type 'inout Int' to specified type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>')}}
73
73
x = p // expected-error{{cannot assign value of type 'UnsafeMutablePointer<Int>' to type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>')}}
74
-
x =&ii // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>')}}
74
+
x =&ii // expected-error{{cannot assign value of type 'inout [Int]' (aka 'inout Array<Int>') to type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>')}}
takesConstVoidPointer([0.0,1.0,2.0]) // expected-error {{cannot convert value of type 'Double' to expected element type '()'}}
133
133
134
134
// We don't allow these conversions outside of function arguments.
135
-
varx:UnsafePointer<Void>=&i // expected-error{{'&' used with non-inout argument of type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>')}}
135
+
varx:UnsafePointer<Void>=&i // expected-error{{cannot convert value of type 'inout Int' to specified type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>')}}
136
136
x = ii // expected-error{{cannot assign value of type '[Int]' to type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>')}}
137
137
x = p // expected-error{{cannot assign value of type 'UnsafeMutablePointer<Int>' to type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>')}}
138
138
x = fp // expected-error{{cannot assign value of type 'UnsafeMutablePointer<Float>' to type 'UnsafePointer<Void>' (aka 'UnsafePointer<()>')}}
takesMutableVoidPointer(s) // expected-error{{cannot convert value of type 'String' to expected argument type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>')}}
154
154
takesMutableInt8Pointer(s) // expected-error{{cannot convert value of type 'String' to expected argument type 'UnsafeMutablePointer<Int8>'}}
155
-
takesMutableInt8Pointer(&s) // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<Int8>'}}
155
+
takesMutableInt8Pointer(&s) // expected-error{{cannot convert value of type 'String' to expected argument type 'Int8'}}
156
156
takesMutablePointer(s) // expected-error{{cannot convert value of type 'String' to expected argument type 'UnsafeMutablePointer<Int>'}}
157
-
takesMutablePointer(&s) // expected-error{{'&' used with non-inout argument of type 'UnsafeMutablePointer<Int>'}}
157
+
takesMutablePointer(&s) // expected-error{{cannot convert value of type 'String' to expected argument type 'Int'}}
0 commit comments