checker: fix immutable to mutable reference#22663
Conversation
|
What do you think @medvednikov @spytheman ? |
|
The failing CI here is really about breakage related to more restricter compiler checks. |
b75f10a to
59273c3
Compare
|
(rebased over current master) |
|
I think that is a very good change, but it should be a notice for a few weeks/months, to avoid sudden breaking changes to existing projects, and allow them to fix the new notices more gradually. It will also solve the CI issues here, and allow for running regression tests with |
…sp/v into fix_immutable_to_mutable
I've changed to notice. 👍🏻 |
|
Thank you @felipensp . |
| } | ||
| if !right.obj.is_mut | ||
| && c.table.final_sym(right_type).kind in [.array, .array_fixed, .map] { | ||
| c.note('left-side of assignment expects a mutable reference, but variable `${right.name}` is immutable, declare it with `mut` to make it mutable or clone it', |
There was a problem hiding this comment.
Perhaps we can mention outside unsafe{} too, but that can wait till later.
The CI is almost finished, and it is working well as it is.
Fix #22653
Fixes cases like this:
Huly®: V_0.6-21112