diff --git a/gen/toir.cpp b/gen/toir.cpp index d248e332..9c95e075 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -2865,7 +2865,7 @@ LLConstant* StructLiteralExp::toConstElem(IRState* p) // return constant struct if (!constType) constType = LLStructType::get(gIR->context(), types); - else + else if (constType->isOpaque()) constType->setBody(types); return LLConstantStruct::get(constType, llvm::makeArrayRef(constvals)); }