bugfix: polymorphic-structs error; onyx package
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 28 Mar 2023 02:20:29 +0000 (21:20 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Tue, 28 Mar 2023 02:20:29 +0000 (21:20 -0500)
compiler/src/polymorph.h
scripts/onyx-pkg.onyx

index 7abab457b14588f68d33a4bd639e5ffc43f402c8..bf43378e48d900e0d23861168c5c126a33ea403f 100644 (file)
@@ -1100,8 +1100,9 @@ char* build_poly_struct_name(AstPolyStructType* ps_type, Type* cs_type) {
 }
 
 Type* polymorphic_struct_lookup(AstPolyStructType* ps_type, bh_arr(AstPolySolution) slns, OnyxFilePos pos, b32 error_if_failed) {
-    // @Cleanup
-    assert(ps_type->scope != NULL);
+    if (ps_type->scope == NULL) {
+        return NULL;
+    }
 
     if (ps_type->concrete_structs == NULL) {
         sh_new_arena(ps_type->concrete_structs);
index 4f9809d9e442bf74485a337fe2aef7b33d420cb3..c96a803dc6355ae6548e25d2018831bd584b1588 100644 (file)
@@ -16,7 +16,8 @@ Version :: SemVer.{0, 1, 1}
 
 
 
-use core
+use core {package, *}
+use runtime
 
 global_arguments: struct {
     #tag "--config-file"