IDEA-101360 Rearrange code action should treat read-only files correctly
(cherry picked from commit e60fd88)
inference: simplify bounds check; ensure fresh variables are treated as same, important e.g. in case of diamond operator when inferred types are new each time they are computed (IDEA-131066)