Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/abi_export.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ function emit_method_info!(ctx::TypeEmitter, method::Core.Method; indent::Int =
for i in 2:length(sig.parameters)
print(ctx.io, " " ^ (indent + 4))
print(ctx.io, "{")
print(ctx.io, " \"name\": ", escape_string_json(argnames[i]), ",")
argname = argnames[i]
name_json = argname == "#unused#" ? "null" : escape_string_json(argname)
print(ctx.io, " \"name\": ", name_json, ",")
print(ctx.io, " \"type_id\": ", ctx.type_ids[sig.parameters[i]])
println(ctx.io, i == length(sig.parameters) ? " }" : " },")
end
Expand Down
4 changes: 4 additions & 0 deletions test/cli.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ end
# `Ptr{CTree{Float64}}` should refer (recursively) back to the original type id
Ptr_CTree_Float64 = abi["types"][CVector_CTree_Float64["fields"][2]["type_id"]]
@test Ptr_CTree_Float64["pointee_type_id"] == CTree_Float64_id

# Unnamed argument names should be exported as empty strings
unnamed = abi["functions"][findfirst(x -> x["symbol"] == "unnamed_arguments", abi["functions"])::Int]
@test all(isnothing, arg["name"] for arg in unnamed["arguments"])
end

@testset "CLI library privatize end-to-end" begin
Expand Down
4 changes: 4 additions & 0 deletions test/libsimple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ Base.@ccallable function countsame(list::Ptr{MyTwoVec}, n::Int32)::Int32
return count
end

Base.@ccallable function unnamed_arguments(::Int32, _::Int32)::Int32
return 0
end

export countsame, copyto_and_sum

# FIXME? varargs
Expand Down
Loading