funcf() throws -> Int { 3 }
funcg() throws {
_ = 3 + tryf() // error: 'try' cannot appear to the right of a non-assignment operator_ = 3 + (tryf()) // OK
}
The diagnostic wording is not quite accurate. In the second line, the try is still on the right of a non-assignment operator and that's alright, it is not on the immediate right.
Maybe we should use "immediate right" instead? I'm not sure if that's too technical, maybe there's a better phrasing without sacrificing accuracy.
If we don't already, we could also provide a fix-it to add parens. (I didn't realize this is something you could do to fix the issue until today, normally I would hoist the try out to immediately follow the = to resolve this issue).
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: aa7426c82efcb81c25f87e34587a5cbb
Issue Description:
The diagnostic wording is not quite accurate. In the second line, the
try
is still on the right of a non-assignment operator and that's alright, it is not on the immediate right.Maybe we should use "immediate right" instead? I'm not sure if that's too technical, maybe there's a better phrasing without sacrificing accuracy.
If we don't already, we could also provide a fix-it to add parens. (I didn't realize this is something you could do to fix the issue until today, normally I would hoist the
try
out to immediately follow the=
to resolve this issue).The text was updated successfully, but these errors were encountered: