Skip to content

Commit 071b846

Browse files
Dale-Blackclaude
andcommitted
Add Base.vect in GlobalRef path for array literals
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c96432e commit 071b846

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/compiler/codegen.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,6 +1053,12 @@ function compile_call(ctx::JSCompilationContext, expr::Expr)
10531053
return compile_string_concat(ctx, args[2:end])
10541054
end
10551055

1056+
# Base.vect — array literal [1, 2, 3]
1057+
if bname === :vect && callee.mod === Base
1058+
call_args_v = [compile_value(ctx, a) for a in args[2:end]]
1059+
return "[$(join(call_args_v, ", "))]"
1060+
end
1061+
10561062
# Base.getindex — array creation (Type[]) or array access (arr[i])
10571063
if bname === :getindex && callee.mod === Base
10581064
# Check if first arg is a Type → empty array creation

0 commit comments

Comments
 (0)