From ac371b72035ef272be7d185cc21a189b64311a86 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Sat, 11 Jun 2022 10:01:31 +0200 Subject: [PATCH] Fix bug where you could have same named decls --- ccodegen.cpp | 2 +- globals.kl | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ccodegen.cpp b/ccodegen.cpp index 922c231..9276bcc 100644 --- a/ccodegen.cpp +++ b/ccodegen.cpp @@ -456,7 +456,7 @@ compile_files(Array filename){ decl->state = DECL_RESOLVED; } - package->decls.add(decl); + insert_into_scope(package, decl); } pctx->currently_parsed_scope = 0; diff --git a/globals.kl b/globals.kl index 52f217c..cf43c89 100644 --- a/globals.kl +++ b/globals.kl @@ -23,7 +23,6 @@ Boolean: Bool = true //----------------------------------------------------------------------------- array1: [4]S64 = {1,2,3,4} imp_array := [5]S64{1,2} -// imp_array := [5]S64{1,2} // @todo this works for some reason // imp_array_a := [5]S64{1,2,3,4,5,6} // imp_array_b: [5]S64 = {1,2,3,4,5,6} imp_array_c: [5]S64 = {[0] = 1, [2] = 2, [1] = 0} // @todo this should be illegal