Skip to content

Destructuring syntax does not respect const annotation #47168

@zengmao

Description

@zengmao

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

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorcompiler:loweringSyntax lowering (compiler front end, 2nd stage)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions