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
[Diagnostics] Extend the AllowInOutConversion fix to cover inout attribute
mismatches in function types.
This improves the diagnostic in cases where we have argument-to-parameter
conversion failures or contextual type mismatches due to inout attribute
mismatches.
fooOW({(x :inoutInt)inreturnInt(5)}) // expected-error {{cannot convert value of type '(inout Int) -> Int' to expected argument type '(__owned _) -> _'}}
40
+
fooOW({(x :inoutInt)inreturnInt(5)}) // expected-error {{cannot convert value of type '(inout Int) -> Int' to expected argument type '(__owned Int) -> Int'}}
fooIO({(x :Int)inreturnInt(5)}) // expected-error {{cannot convert value of type '(inout Int) -> Int' to expected argument type '(inout _) -> _'}}
45
-
fooIO({(x :__shared Int)inreturnInt(5)}) // expected-error {{cannot convert value of type '(__shared Int) -> Int' to expected argument type '(inout _) -> _'}}
46
-
fooIO({(x :__owned Int)inreturnInt(5)}) // expected-error {{cannot convert value of type '(__owned Int) -> Int' to expected argument type '(inout _) -> _'}}
44
+
fooIO({(x :Int)inreturnInt(5)}) // expected-error {{cannot convert value of type '(Int) -> Int' to expected argument type '(inout Int) -> Int'}}
45
+
fooIO({(x :__shared Int)inreturnInt(5)}) // expected-error {{cannot convert value of type '(__shared Int) -> Int' to expected argument type '(inout Int) -> Int'}}
46
+
fooIO({(x :__owned Int)inreturnInt(5)}) // expected-error {{cannot convert value of type '(__owned Int) -> Int' to expected argument type '(inout Int) -> Int'}}
fooSH({(x :inoutInt)inreturnInt(5)}) // expected-error {{cannot convert value of type '(inout Int) -> Int' to expected argument type '(__shared _) -> _'}}
51
+
fooSH({(x :inoutInt)inreturnInt(5)}) // expected-error {{cannot convert value of type '(inout Int) -> Int' to expected argument type '(__shared Int) -> Int'}}
0 commit comments