-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:loweringSyntax lowering (compiler front end, 2nd stage)Syntax lowering (compiler front end, 2nd stage)
Description
The const keyword seems to have no effect when used with the destructuring syntax in Julia 1.7+.
julia> t = (;a = 1, b = 2);
julia> const (;a, b) = t
(a = 1, b = 2)
julia> a = 3 # re-definition produces no error or warning, so a is not const
3
My Julia version is 1.8.2, 64-bit Linux (glibc), installed from the binary tarball.
(First posted on Discourse: https://discourse.julialang.org/t/destructuring-syntax-does-not-respect-const-annotation/88751)
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:loweringSyntax lowering (compiler front end, 2nd stage)Syntax lowering (compiler front end, 2nd stage)