Skip to content

Commit 662cd0a

Browse files
committed
fix #8156
1 parent d040ceb commit 662cd0a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/cgutils.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ static Type *julia_struct_to_llvm(jl_value_t *jt)
505505
lty = jl_pvalue_llvmt;
506506
else
507507
lty = ty==(jl_value_t*)jl_bool_type ? T_int8 : julia_type_to_llvm(ty);
508+
if (lty == T_void || lty->isEmptyTy())
509+
continue;
508510
latypes.push_back(lty);
509511
}
510512
structdecl->setBody(latypes);

test/core.jl

+10
Original file line numberDiff line numberDiff line change
@@ -1829,3 +1829,13 @@ end
18291829

18301830
# issue #7582
18311831
aₜ = "a variable using Unicode 6"
1832+
1833+
immutable My8156{A, B}
1834+
a::A
1835+
b::B
1836+
end
1837+
let m = My8156(nothing, 1)
1838+
@test sizeof(m) == sizeof(1)
1839+
@test m.a === nothing
1840+
@test m.b === 1
1841+
end

0 commit comments

Comments
 (0)