diff options
| author | Alexandros Naskos <alex_naskos@hotmail.com> | 2018-04-27 05:10:20 +0300 |
|---|---|---|
| committer | Alexandros Naskos <alex_naskos@hotmail.com> | 2018-04-27 05:10:20 +0300 |
| commit | ea2596280fc2c78f71b08921db3a4c9826eb93e0 (patch) | |
| tree | be9a1fb60d8613f38d40d4077acd8531db5cdeb1 /src | |
| parent | 8f703f919f13e23b2c09f577a446aabb7799e27c (diff) | |
| download | zig-ea2596280fc2c78f71b08921db3a4c9826eb93e0.tar.gz zig-ea2596280fc2c78f71b08921db3a4c9826eb93e0.zip | |
Added BoundFn TypeInfo generation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.cpp | 7 | ||||
| -rw-r--r-- | src/ir.cpp | 11 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index ee85d7d3c4..fc872e1908 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6378,7 +6378,7 @@ static void define_builtin_compile_vars(CodeGen *g) { " Fn: Fn,\n" " Namespace: void,\n" " Block: void,\n" - " BoundFn: BoundFn,\n" + " BoundFn: Fn,\n" " ArgTuple: void,\n" " Opaque: void,\n" " Promise: Promise,\n" @@ -6494,11 +6494,6 @@ static void define_builtin_compile_vars(CodeGen *g) { " args: []FnArg,\n" " };\n" "\n" - " pub const BoundFn = struct {\n" - " bound_type: type,\n" - " fn_info: Fn,\n" - " };\n" - "\n" " pub const Promise = struct {\n" " child: type,\n" " };\n" diff --git a/src/ir.cpp b/src/ir.cpp index a7076a3243..c2da83886a 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -16241,7 +16241,7 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t result->special = ConstValSpecialStatic; result->type = ir_type_info_get_type(ira, "Fn"); - ConstExprValue *fields = create_const_vals(5); + ConstExprValue *fields = create_const_vals(6); result->data.x_struct.fields = fields; // @TODO Fix type = undefined with ?type @@ -16327,6 +16327,15 @@ static ConstExprValue *ir_make_type_info_value(IrAnalyze *ira, TypeTableEntry *t break; } + case TypeTableEntryIdBoundFn: + { + // @TODO figure out memory corruption error. + TypeTableEntry *fn_type = type_entry->data.bound_fn.fn_type; + assert(fn_type->id == TypeTableEntryIdFn); + result = ir_make_type_info_value(ira, fn_type); + + break; + } } assert(result != nullptr); |
