Skip to content

Commit

Permalink
Fix and add test for the Gtk pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Aug 4, 2024
1 parent d1d842e commit 5443fcd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ JL_DLLEXPORT jl_binding_t *jl_get_binding_wr(jl_module_t *m JL_PROPAGATES_ROOT,
{
jl_binding_t *b = jl_get_module_binding(m, var, 1);
jl_binding_partition_t *bpart = jl_get_binding_partition(b, jl_current_task->world_age);
if (bpart->kind != BINDING_KIND_GLOBAL) {
if (bpart->kind != BINDING_KIND_GLOBAL && bpart->kind != BINDING_KIND_CONST && bpart->kind != BINDING_KIND_CONST_IMPORT) {
if (jl_bpart_is_some_guard(bpart)) {
check_safe_newbinding(m, var);
if (!alloc)
Expand Down
7 changes: 7 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3928,3 +3928,10 @@ module ImportConstantTestModule
@test ImportConstant == 1
@test isconst(@__MODULE__, :ImportConstant)
end

# Test trying to define a constant and then trying to assign to the same value
module AssignConstValueTest
const x = 1
x = 1
end
@test isconst(AssignConstValueTest, :x)

0 comments on commit 5443fcd

Please sign in to comment.