Skip to content

Commit eabf39c

Browse files
mlechuaviatesk
authored andcommitted
Small change to struct desugaring
Part of JuliaLang/julia#56497. `insert-struct-shim` (for the a self-reference case) is omitted for now.
1 parent 6a6eba1 commit eabf39c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/desugaring.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3961,16 +3961,17 @@ function expand_struct_def(ctx, ex, docs)
39613961
]
39623962
end
39633963
]
3964-
# Otherwise do an assignment to trigger an error
3965-
[K"const" global_struct_name struct_name]
39663964
]
3967-
[K"const" global_struct_name struct_name]
39683965
]
39693966
[K"call"(type_body)
39703967
"_typebody!"::K"core"
39713968
struct_name
39723969
[K"call" "svec"::K"core" field_types...]
39733970
]
3971+
[K"const"
3972+
global_struct_name
3973+
newtype_var
3974+
]
39743975
# Default constructors
39753976
if isempty(inner_defs)
39763977
default_inner_constructors(ctx, ex, global_struct_name,

0 commit comments

Comments
 (0)