From 9041d0d37e59e3f07d568f93bd680cc0065d1cd2 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Fri, 27 Apr 2018 02:05:24 +0300 Subject: Fixed enum tag type detection in TypeInfo generation. --- src/codegen.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 77794c2ab9..b6236197cc 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6349,6 +6349,12 @@ static void define_builtin_compile_vars(CodeGen *g) { } { // @TODO Add Namespace info. + // @TODO Methods -> definitions + // @TODO Includes type definitions (name + type bound) + functions + const variable definitions (+ type of variable) + // @TODO Type definitions are defined as variable definitions of type 'type' + // @TODO This should give us everything available. + // @TODO An alternative is exposing the value of every variable definition, check out if it's possible and wether we want that. + // @TODO I don't think so, @field gives it to us for free. buf_appendf(contents, "pub const TypeInfo = union(TypeId) {\n" " Type: void,\n" @@ -6453,7 +6459,7 @@ static void define_builtin_compile_vars(CodeGen *g) { "\n" " pub const UnionField = struct {\n" " name: []const u8,\n" - " enum_field: EnumField,\n" + " enum_field: ?EnumField,\n" " field_type: type,\n" " };\n" "\n" -- cgit v1.2.3