From 9c66b193b80f6ef3e2165ab643440b4252afc8d6 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Wed, 30 Dec 2020 10:26:14 -0600 Subject: [PATCH] updated CHANGELOG --- CHANGELOG | 8 ++++++++ docs/todo | 2 +- onyx | Bin 287128 -> 287128 bytes src/onyxsymres.c | 4 ++-- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 66563b91..20ede32f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Release v0.0.6 -------------- Additions: +* #solidify directive for explicitly specifying type variables in polymorphic procs. * properly different kinds of allocators in core/alloc/. * `map.empty` * `string.compare` @@ -10,8 +11,14 @@ Additions: * `map.update` Removals: +* struct literals can no longer specify values for members brought in through a `use`. Changes: +* `::` declarations in a procedure are treated differently now. They used to represent a constant + value, but one that was still computed at the assignment site. Now, they instead are used to + declare top level expressions in the procedure scope. This means that things like structs and + enums can be declared at any block scope. The top-level expressions currently do not have + access to polymoprhic variables in the procedure. * enum values are compile time known. * struct literals are compile time known can be used at top level scope. * range literals are proper things in the compiler code now. @@ -20,6 +27,7 @@ Changes: Bug fixes: * polymorphic procedures would get 'confused' when two structs in the program had the same name. * function argument type mismatch would give wrong function name. +* `structs` with `use`d members caused all sorts of problems. Release v0.0.5 diff --git a/docs/todo b/docs/todo index d6d7ed07..8bcd3ee2 100644 --- a/docs/todo +++ b/docs/todo @@ -68,7 +68,7 @@ Language Cohesion: is that 'use package' can only be at the top level, and 'use' can only be used at the block level. - [ ] :: should not declare a local variable, just bind a name to an expression. + [X] :: should not declare a local variable, just bind a name to an expression. They can still be lexically scoped. [X] Currently accessing a field directly on a function call produces invalid diff --git a/onyx b/onyx index 4d1f1a5c10d23e7c7f443e998ec27d30953d3c7a..0445ec27d27aa100c3fff70681c0ddc42216771a 100755 GIT binary patch delta 59 zcmbPnSa8N+!3|fKL{2$YHzpg%E^~9>YG>vZIaqzg@>uf=rtL4782?HzTC_itW&~m; NAZFhFOqykrD*)Ia7svnr delta 59 zcmbPnSa8N+!3|fKMEKOS>o!ijp(MXZ+b_u{bHVgqUv@RWVA}qIiSe%lqelBPX+|Js O0%GRv&!ky4xdH$O>ls=A diff --git a/src/onyxsymres.c b/src/onyxsymres.c index 6718dfb6..95d7e4bf 100644 --- a/src/onyxsymres.c +++ b/src/onyxsymres.c @@ -869,14 +869,14 @@ static void symres_enum(AstEnumType* enum_node) { return; } - (*value)->value->type = enum_node->backing_type; + (*value)->value->type = enum_node->etcache; } else { AstNumLit* num = onyx_ast_node_new(semstate.node_allocator, sizeof(AstNumLit), Ast_Kind_NumLit); num->value.l = next_assign_value; num->flags |= Ast_Flag_Comptime; num->type = enum_node->etcache; - + (*value)->value = num; } -- 2.25.1