mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
[goalc] Fix error when putting #f in an array of symbols (#1804)
This commit is contained in:
parent
24590ec670
commit
bc3cd2cf72
|
@ -848,8 +848,10 @@ void Compiler::fill_static_array_inline(const goos::Object& form,
|
||||||
typecheck(form, TypeSpec("integer"), sr.typespec());
|
typecheck(form, TypeSpec("integer"), sr.typespec());
|
||||||
} else {
|
} else {
|
||||||
if (sr.is_symbol() && sr.symbol_name() == "#f") {
|
if (sr.is_symbol() && sr.symbol_name() == "#f") {
|
||||||
// allow #f for any structure.
|
// allow #f for any structure, or symbol (no longer a structure in jak 2)
|
||||||
typecheck(form, TypeSpec("structure"), content_type);
|
if (content_type.base_type() != "symbol") {
|
||||||
|
typecheck(form, TypeSpec("structure"), content_type);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
typecheck(form, content_type, sr.typespec());
|
typecheck(form, content_type, sr.typespec());
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
(-> type parent parent parent)
|
(-> type parent parent parent)
|
||||||
(-> type parent 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: () () () #t #f\
|
||||||
empty pair type: pair
|
empty pair type: pair
|
||||||
|
@ -34,4 +37,5 @@ basic types: type symbol string function
|
||||||
bools: #t #f #t #f #f #t
|
bools: #t #f #t #f #f #t
|
||||||
zero: 0
|
zero: 0
|
||||||
parent of type: basic structure object object
|
parent of type: basic structure object object
|
||||||
|
array: asdf #f
|
||||||
|#
|
|#
|
||||||
|
|
|
@ -51,5 +51,6 @@ TEST_F(Jak2GoalcTests, All) {
|
||||||
"basic types: type symbol string function\n"
|
"basic types: type symbol string function\n"
|
||||||
"bools: #t #f #t #f #f #t\n"
|
"bools: #t #f #t #f #f #t\n"
|
||||||
"zero: 0\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"});
|
||||||
}
|
}
|
Loading…
Reference in a new issue