bugfix? and added docs
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 4 Feb 2023 22:17:23 +0000 (16:17 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Sat, 4 Feb 2023 22:17:23 +0000 (16:17 -0600)
compiler/src/types.c
docs/ideas/high_level_goals.md [new file with mode: 0644]
docs/ideas/mapped_directories.md
docs/ideas/templated_projects.md [new file with mode: 0644]

index b12f7c67a20a2430f60c5113ab84f5a55981ceba..86d4b083a82ac02ba6ba6a1327b4a2fd803e1e6b 100644 (file)
@@ -390,6 +390,12 @@ Type* type_build_from_ast(bh_allocator alloc, AstType* type_node) {
                     return NULL;
                 }
 
+                if ((*member)->type->kind == Type_Kind_Struct
+                    && (*member)->type->Struct.status == SPS_Start) {
+                    s_node->pending_type_is_valid = 0;
+                    return NULL;
+                }
+
                 mem_alignment = type_alignment_of((*member)->type);
                 if (mem_alignment <= 0) {
                     onyx_report_error((*member)->token->pos, Error_Critical, "Invalid member type: %s. Has alignment %d", type_get_name((*member)->type), mem_alignment);
diff --git a/docs/ideas/high_level_goals.md b/docs/ideas/high_level_goals.md
new file mode 100644 (file)
index 0000000..66c6bc4
--- /dev/null
@@ -0,0 +1,12 @@
+High-Level Goals
+
+There are many ideas  that are wizzing around my head
+when I think about the future of Onyx, and I'm having
+a hard-time deciding  what needs to be done and when.
+I think writing everything out and creating a (rough)
+timeline will  be beneficial to me  and the future of
+the language.
+
+
+
+
index f9bc94d30754dc4f28439eb8b2f309e7471a91ce..83e9eff174e26760230cad1ad7b931c34609d557 100644 (file)
@@ -1,2 +1,19 @@
 Mapped Directories
-==================
\ No newline at end of file
+==================
+
+I am thinking about complicating how the file resolution
+system works when loading new files. Currently, it is
+intentionally very simple. There is a global "search path"
+that will be sequentially appended to the file path being
+loaded, and the first full path that is a file will be used.
+This makes it easy to use, but also causes some confusion.
+
+I think it would be worth investigating using a *relative only*
+scheme for file resolution, UNLESS you specify the full path,
+or a *mapped directory* to use as the base directory.
+
+For example, instead of relying on "/usr/share/onyx" to be in
+the search path to make "core/std" work, we would instead have
+"core" be a mapped directory to "/usr/share/onyx/core". Then,
+you would say, `#load "core:std"` or `#load core "std"` to
+specify the base path.
diff --git a/docs/ideas/templated_projects.md b/docs/ideas/templated_projects.md
new file mode 100644 (file)
index 0000000..4f066ec
--- /dev/null
@@ -0,0 +1,4 @@
+Templated Projects
+==================
+
+