Ethiraric c6cb0e99f3 [unnecessary_cast]: Avoid breaking precedence
If the whole cast expression is a unary expression (`(*x as T)`) or an
addressof expression (`(&x as T)`), then not surrounding the suggestion
into a block risks us changing the precedence of operators if the cast
expression is followed by an operation with higher precedence than the
unary operator (`(*x as T).foo()` would become `*x.foo()`, which changes
what the `*` applies on).
The same is true if the expression encompassing the cast expression is a
unary expression or an addressof expression.

The lint supports the latter case, but missed the former one. This PR
fixes that.

Fixes #11968
2024-02-27 16:27:12 +01:00
..
2024-02-20 07:53:04 +10:00
2024-02-20 07:53:04 +10:00
2024-02-24 15:02:10 +01:00
2024-02-24 15:02:10 +01:00
2024-02-24 15:02:10 +01:00
2024-02-15 06:22:15 +09:00
2024-02-23 17:38:39 +01:00
2024-02-21 23:26:29 +09:00
2024-02-21 23:26:29 +09:00
2024-02-23 17:38:39 +01:00
2024-02-24 00:35:48 +08:00
2024-02-24 00:35:48 +08:00
2024-02-24 00:35:48 +08:00