| author | |
| committer | |
| log | ea2596280fc2c78f71b08921db3a4c9826eb93e0 |
| tree | be9a1fb60d8613f38d40d4077acd8531db5cdeb1 |
| parent | 8f703f919f13e23b2c09f577a446aabb7799e27c |
2 files changed, 11 insertions(+), 7 deletions(-)
src/codegen.cpp+1-6| ... | @@ -6378,7 +6378,7 @@ static void define_builtin_compile_vars(CodeGen *g) { | ... | @@ -6378,7 +6378,7 @@ static void define_builtin_compile_vars(CodeGen *g) { |
| 6378 | " Fn: Fn,\n" | 6378 | " Fn: Fn,\n" |
| 6379 | " Namespace: void,\n" | 6379 | " Namespace: void,\n" |
| 6380 | " Block: void,\n" | 6380 | " Block: void,\n" |
| 6381 | " BoundFn: BoundFn,\n" | 6381 | " BoundFn: Fn,\n" |
| 6382 | " ArgTuple: void,\n" | 6382 | " ArgTuple: void,\n" |
| 6383 | " Opaque: void,\n" | 6383 | " Opaque: void,\n" |
| 6384 | " Promise: Promise,\n" | 6384 | " Promise: Promise,\n" |
| ... | @@ -6494,11 +6494,6 @@ static void define_builtin_compile_vars(CodeGen *g) { | ... | @@ -6494,11 +6494,6 @@ static void define_builtin_compile_vars(CodeGen *g) { |
| 6494 | " args: []FnArg,\n" | 6494 | " args: []FnArg,\n" |
| 6495 | " };\n" | 6495 | " };\n" |
| 6496 | "\n" | 6496 | "\n" |
| 6497 | " pub const BoundFn = struct {\n" | ||
| 6498 | " bound_type: type,\n" | ||
| 6499 | " fn_info: Fn,\n" | ||
| 6500 | " };\n" | ||
| 6501 | "\n" | ||
| 6502 | " pub const Promise = struct {\n" | 6497 | " pub const Promise = struct {\n" |
| 6503 | " child: type,\n" | 6498 | " child: type,\n" |
| 6504 | " };\n" | 6499 | " };\n" |
src/ir.cpp+10-1| ... | @@ -16241,7 +16241,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t | ... | @@ -16241,7 +16241,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t |
| 16241 | result->special = ConstValSpecialStatic; | 16241 | result->special = ConstValSpecialStatic; |
| 16242 | result->type = ir_type_info_get_type(ira, "Fn"); | 16242 | result->type = ir_type_info_get_type(ira, "Fn"); |
| 16243 | 16243 | ||
| 16244 | ConstExprValue *fields = create_const_vals(5); | 16244 | ConstExprValue *fields = create_const_vals(6); |
| 16245 | result->data.x_struct.fields = fields; | 16245 | result->data.x_struct.fields = fields; |
| 16246 | 16246 | ||
| 16247 | // @TODO Fix type = undefined with ?type | 16247 | // @TODO Fix type = undefined with ?type |
| ... | @@ -16325,6 +16325,15 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t | ... | @@ -16325,6 +16325,15 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t |
| 16325 | fn_arg_val->data.x_struct.parent.data.p_array.elem_index = fn_arg_index; | 16325 | fn_arg_val->data.x_struct.parent.data.p_array.elem_index = fn_arg_index; |
| 16326 | } | 16326 | } |
| 16327 | 16327 | ||
| 16328 | break; | ||
| 16329 | } | ||
| 16330 | case TypeTableEntryIdBoundFn: | ||
| 16331 | { | ||
| 16332 | // @TODO figure out memory corruption error. | ||
| 16333 | TypeTableEntry *fn_type = type_entry->data.bound_fn.fn_type; | ||
| 16334 | assert(fn_type->id == TypeTableEntryIdFn); | ||
| 16335 | result = ir_make_type_info_value(ira, fn_type); | ||
| 16336 | |||
| 16328 | break; | 16337 | break; |
| 16329 | } | 16338 | } |
| 16330 | } | 16339 | } |