diff --git a/code/demo.odin b/code/demo.odin index 69d0763bb..c548a9430 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -6,7 +6,15 @@ #import "opengl.odin"; #import "os.odin"; +foo :: proc(x: int) -> f32 { + return 123; +} + main :: proc() { + + fmt.printf("%T\n", foo); + +when false { /* Version 0.1.1 @@ -57,6 +65,9 @@ main :: proc() { To come very Soon™: * Linux and OS X builds (unofficial ones do exist already) */ + { + + } { Fruit :: enum { @@ -145,4 +156,5 @@ main :: proc() { // align_of([vector 7]i32) != align_of([7]i32) // this may be the case } } +} diff --git a/src/ir.c b/src/ir.c index bd91748f4..388f747a3 100644 --- a/src/ir.c +++ b/src/ir.c @@ -6504,10 +6504,10 @@ void ir_gen_tree(irGen *s) { irValue *variadic = ir_emit_struct_ep(proc, tag, 2); irValue *convention = ir_emit_struct_ep(proc, tag, 3); - if (t->Proc.params) { + if (t->Proc.params != NULL) { ir_emit_store(proc, params, ir_get_type_info_ptr(proc, t->Proc.params)); } - if (t->Proc.results) { + if (t->Proc.results != NULL) { ir_emit_store(proc, results, ir_get_type_info_ptr(proc, t->Proc.results)); } ir_emit_store(proc, variadic, ir_make_const_bool(a, t->Proc.variadic)); @@ -6525,8 +6525,8 @@ void ir_gen_tree(irGen *s) { ir_emit_store(proc, ir_emit_struct_ep(proc, record, 4), align); } - irValue *memory_types = ir_type_info_member_types_offset(proc, t->Record.field_count); - irValue *memory_names = ir_type_info_member_names_offset(proc, t->Record.field_count); + irValue *memory_types = ir_type_info_member_types_offset(proc, t->Tuple.variable_count); + irValue *memory_names = ir_type_info_member_names_offset(proc, t->Tuple.variable_count); for (isize i = 0; i < t->Tuple.variable_count; i++) { // NOTE(bill): offset is not used for tuples @@ -6542,8 +6542,8 @@ void ir_gen_tree(irGen *s) { } } - ir_fill_slice(proc, ir_emit_struct_ep(proc, record, 0), memory_types, ir_make_const_int(a, t->Record.field_count)); - ir_fill_slice(proc, ir_emit_struct_ep(proc, record, 1), memory_names, ir_make_const_int(a, t->Record.field_count)); + ir_fill_slice(proc, ir_emit_struct_ep(proc, record, 0), memory_types, ir_make_const_int(a, t->Tuple.variable_count)); + ir_fill_slice(proc, ir_emit_struct_ep(proc, record, 1), memory_names, ir_make_const_int(a, t->Tuple.variable_count)); } break; case Type_Record: { switch (t->Record.kind) {