diff options
| -rw-r--r-- | src/bootstrap/codegen.pry | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bootstrap/codegen.pry b/src/bootstrap/codegen.pry index 5f63038..06efda5 100644 --- a/src/bootstrap/codegen.pry +++ b/src/bootstrap/codegen.pry @@ -889,6 +889,19 @@ let codegen_generate_expression_value = (c: *codegen, expression: *Node, name: * v.node_type = simple_type_node; return codegen_create_variable(c, v); }; + + if ((*expression).type == NODE_TYPE_SIMPLE_TYPE) { + let simple_type_data = *cast(*NODE_TYPE_SIMPLE_TYPE_DATA, (*expression).data); + let typ = codegen_get_llvm_type(c, simple_type_data.underlying_type); + assert(typ != cast(*LLVMTypeRef, null)); + let v = Variable{}; + v.value = cast(LLVMValueRef, null); + v.type = *typ; + v.stack_level = cast(*i64, null); + v.node = expression; + v.node_type = simple_type_data.underlying_type; + return codegen_create_variable(c, v); + }; if ((*expression).type == NODE_STRUCT_INSTANCIATION) { let struc_data = *cast(*NODE_STRUCT_INSTANCIATION_DATA, (*expression).data); |