diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 6134cc815376b..68979c5393081 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -505,6 +505,8 @@ static Type *julia_struct_to_llvm(jl_value_t *jt) lty = jl_pvalue_llvmt; else lty = ty==(jl_value_t*)jl_bool_type ? T_int8 : julia_type_to_llvm(ty); + if (lty == T_void || lty->isEmptyTy()) + continue; latypes.push_back(lty); } structdecl->setBody(latypes); diff --git a/test/core.jl b/test/core.jl index a04bf1443ac20..25c28be630baf 100644 --- a/test/core.jl +++ b/test/core.jl @@ -1829,3 +1829,13 @@ end # issue #7582 aₜ = "a variable using Unicode 6" + +immutable My8156{A, B} + a::A + b::B +end +let m = My8156(nothing, 1) + @test sizeof(m) == sizeof(1) + @test m.a === nothing + @test m.b === 1 +end