diff --git a/goalc/compiler/compilation/Static.cpp b/goalc/compiler/compilation/Static.cpp index 8c1a40149..4bd9e3d82 100644 --- a/goalc/compiler/compilation/Static.cpp +++ b/goalc/compiler/compilation/Static.cpp @@ -848,8 +848,10 @@ void Compiler::fill_static_array_inline(const goos::Object& form, typecheck(form, TypeSpec("integer"), sr.typespec()); } else { if (sr.is_symbol() && sr.symbol_name() == "#f") { - // allow #f for any structure. - typecheck(form, TypeSpec("structure"), content_type); + // allow #f for any structure, or symbol (no longer a structure in jak 2) + if (content_type.base_type() != "symbol") { + typecheck(form, TypeSpec("structure"), content_type); + } } else { typecheck(form, content_type, sr.typespec()); } diff --git a/test/goalc/source_templates/jak2/jak2-mega-test.gc b/test/goalc/source_templates/jak2/jak2-mega-test.gc index cf68dd2b5..72792c3d9 100644 --- a/test/goalc/source_templates/jak2/jak2-mega-test.gc +++ b/test/goalc/source_templates/jak2/jak2-mega-test.gc @@ -26,6 +26,9 @@ (-> type parent parent parent) (-> type parent parent parent parent)) +(define *array-of-syms* (new 'static 'array symbol 2 'asdf #f)) +(format #t "array: ~A ~A~%" (-> *array-of-syms* 0) (-> *array-of-syms* 1)) + #| empty pair: () () () #t #f\ empty pair type: pair @@ -34,4 +37,5 @@ basic types: type symbol string function bools: #t #f #t #f #f #t zero: 0 parent of type: basic structure object object +array: asdf #f |# diff --git a/test/goalc/test_jak2_compiler.cpp b/test/goalc/test_jak2_compiler.cpp index 3359bfd53..6572c4a1c 100644 --- a/test/goalc/test_jak2_compiler.cpp +++ b/test/goalc/test_jak2_compiler.cpp @@ -51,5 +51,6 @@ TEST_F(Jak2GoalcTests, All) { "basic types: type symbol string function\n" "bools: #t #f #t #f #f #t\n" "zero: 0\n" - "parent of type: basic structure object object\n0\n"}); + "parent of type: basic structure object object\n" + "array: asdf #f\n0\n"}); } \ No newline at end of file