Skip to content

Commit af8e042

Browse files
committed
Rename type to type_id
1 parent c8a0c0b commit af8e042

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

contrib/juliac/abi_export.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function emit_pointer_info!(ctx::TypeEmitter, @nospecialize(dt::DataType); inden
7474
indented_println(" \"id\": ", ctx.type_ids[dt], ",")
7575
indented_println(" \"kind\": \"pointer\",")
7676
indented_println(" \"name\": ", type_name_json(dt), ",")
77-
indented_println(" \"pointee\": ", pointee_type_id)
77+
indented_println(" \"pointee_type_id\": ", pointee_type_id)
7878
print(ctx.io, " " ^ indent, "}")
7979
end
8080
end
@@ -85,7 +85,7 @@ function emit_field_info!(ctx::TypeEmitter, @nospecialize(dt::DataType), field::
8585
print(ctx.io, " " ^ indent)
8686
print(ctx.io, "{")
8787
print(ctx.io, " \"name\": ", field_name_json(dt, field), ",")
88-
print(ctx.io, " \"type\": ", type_id, ",")
88+
print(ctx.io, " \"type_id\": ", type_id, ",")
8989
print(ctx.io, " \"offset\": ", desc.offset)
9090
print(ctx.io, " }")
9191
end
@@ -161,11 +161,11 @@ function emit_method_info!(ctx::TypeEmitter, method::Core.Method; indent::Int =
161161
print(ctx.io, " " ^ (indent + 4))
162162
print(ctx.io, "{")
163163
print(ctx.io, " \"name\": ", escape_string_json(argnames[i]), ",")
164-
print(ctx.io, " \"type\": ", ctx.type_ids[sig.parameters[i]])
164+
print(ctx.io, " \"type_id\": ", ctx.type_ids[sig.parameters[i]])
165165
println(ctx.io, i == length(sig.parameters) ? " }" : " },")
166166
end
167167
indented_println(" ],")
168-
indented_println(" \"returns\": { \"type\": ", ctx.type_ids[rt], " }")
168+
indented_println(" \"returns\": { \"type_id\": ", ctx.type_ids[rt], " }")
169169
print(ctx.io, " " ^ indent, "}")
170170
end
171171
end

test/trimming/trimming.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ let exe_suffix = splitext(Base.julia_exename())[2]
4343
@test length(CVector_Float32["fields"]) == 2
4444
@test CVector_Float32["fields"][1]["offset"] == 0
4545
@test CVector_Float32["fields"][2]["offset"] == 8
46-
@test abi["types"][CVector_Float32["fields"][1]["type"]]["name"] == "Int32"
47-
@test abi["types"][CVector_Float32["fields"][2]["type"]]["name"] == "Ptr{Float32}"
46+
@test abi["types"][CVector_Float32["fields"][1]["type_id"]]["name"] == "Int32"
47+
@test abi["types"][CVector_Float32["fields"][2]["type_id"]]["name"] == "Ptr{Float32}"
4848
@test CVector_Float32["size"] == 16
4949

5050
# `CVectorPair{Float32}` should have been exported with the correct info
@@ -53,7 +53,7 @@ let exe_suffix = splitext(Base.julia_exename())[2]
5353
@test length(CVectorPair_Float32["fields"]) == 2
5454
@test CVectorPair_Float32["fields"][1]["offset"] == 0
5555
@test CVectorPair_Float32["fields"][2]["offset"] == 16
56-
@test abi["types"][CVectorPair_Float32["fields"][1]["type"]]["name"] == "CVector{Float32}"
57-
@test abi["types"][CVectorPair_Float32["fields"][2]["type"]]["name"] == "CVector{Float32}"
56+
@test abi["types"][CVectorPair_Float32["fields"][1]["type_id"]]["name"] == "CVector{Float32}"
57+
@test abi["types"][CVectorPair_Float32["fields"][2]["type_id"]]["name"] == "CVector{Float32}"
5858
@test CVectorPair_Float32["size"] == 32
5959
end

0 commit comments

Comments
 (0)