Skip to content

Commit

Permalink
sema: fix interior mutability analysis for structure copy assignments
Browse files Browse the repository at this point in the history
mertcandav committed Jan 12, 2025
1 parent e2bf3de commit 407df72
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion std/jule/sema/scope.jule
Original file line number Diff line number Diff line change
@@ -1136,7 +1136,10 @@ impl scopeChecker {
ret
}
root := self.getHardRoot()
if root.owner.Owner != s {
// Owner is not structure or structure is mutable.
// If structure is mutable, it means there is risky mutable-typed
// fields even for internal members.
if root.owner.Owner != s || s.Mutable {
ret
}
// Mark data as mutable.

0 comments on commit 407df72

Please sign in to comment.