mirror of
https://github.com/open-goal/jak-project
synced 2026-07-08 14:36:52 -04:00
another fix for forward declared types (#647)
This commit is contained in:
@@ -1353,14 +1353,14 @@ EnumType* TypeSystem::try_enum_lookup(const TypeSpec& type) const {
|
||||
* Get a path from type to object.
|
||||
*/
|
||||
std::vector<std::string> TypeSystem::get_path_up_tree(const std::string& type) const {
|
||||
auto parent = lookup_type(type)->get_parent();
|
||||
auto parent = lookup_type_allow_partial_def(type)->get_parent();
|
||||
std::vector<std::string> path = {type};
|
||||
path.push_back(parent);
|
||||
auto parent_type = lookup_type(parent);
|
||||
auto parent_type = lookup_type_allow_partial_def(parent);
|
||||
|
||||
while (parent_type->has_parent()) {
|
||||
parent = parent_type->get_parent();
|
||||
parent_type = lookup_type(parent);
|
||||
parent_type = lookup_type_allow_partial_def(parent);
|
||||
path.push_back(parent);
|
||||
}
|
||||
|
||||
|
||||
@@ -168,4 +168,6 @@
|
||||
- Added a `type-ref` form to insert a reference to a type into a static structure and optionally forward declare the number of methods
|
||||
- The `method-of-type` form will now accept an expression returning a type instead of just a type name. In this case, it will only allow you to access method of `object`.
|
||||
- Added a `defun-recursive` to make it easier to define recursive functions
|
||||
- Forward declared basics can be used in more places
|
||||
- Forward declared basics can be used in more places
|
||||
- You can now set a field which has a forward declared structure or basic type
|
||||
- `cdr` now returns an object of type `pair`.
|
||||
@@ -1093,7 +1093,7 @@ Val* Compiler::compile_cdr(const goos::Object& form, const goos::Object& rest, E
|
||||
if (pair->type() != m_ts.make_typespec("object")) {
|
||||
typecheck(form, m_ts.make_typespec("pair"), pair->type(), "Type of argument to cdr");
|
||||
}
|
||||
auto result = fe->alloc_val<PairEntryVal>(m_ts.make_typespec("object"), pair, false);
|
||||
auto result = fe->alloc_val<PairEntryVal>(m_ts.make_typespec("pair"), pair, false);
|
||||
result->mark_as_settable();
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user