Skip to content

Commit

Permalink
fix dynamic decl
Browse files Browse the repository at this point in the history
  • Loading branch information
FindDefinition committed Sep 25, 2022
1 parent 2f5b920 commit 52b2c87
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,4 +1,8 @@
# Changelog
## [0.4.2] - 2022-09-25
### Fixed
* Fix dynamic decl problem.

## [0.4.1] - 2022-09-25
### Fixed
* fix small bug in annotation gen.
Expand Down
9 changes: 5 additions & 4 deletions pccm/core/__init__.py
Expand Up @@ -2037,7 +2037,9 @@ def build_graph(self,
# construct unified dependency and assign namespace for Class
if not cur_cu.graph_inited:
# extract deps in code object
for decl in self.cached_extract_classunit_methods(cur_cu):
decls_static = self.cached_extract_classunit_methods(cur_cu)
decl_dynamic = cur_cu._function_decls
for decl in decls_static + decl_dynamic:
code_obj = decl.code
# decl.meta.name
for dep_with_meta in code_obj._impl_only_deps:
Expand All @@ -2049,7 +2051,7 @@ def build_graph(self,
dep_pcls, dep_subns = dep_with_meta.get_param_class_and_ns()
cur_cu.add_impl_only_param_class_by_name(
decl.get_function_name(), dep_subns, dep_pcls, dep_with_meta.alias)

for dep_obj in cur_cu.get_class_deps():
cu_type = dep_obj.get_class_type()
if cu_type in cur_type_trace:
Expand Down Expand Up @@ -2082,8 +2084,7 @@ def build_graph(self,
cur_type_trace_copy = cur_type_trace.copy()
cur_type_trace_copy.add(pcls)
stack.append((pcls, cur_type_trace_copy))
cur_cu._function_decls.extend(
self.cached_extract_classunit_methods(cur_cu))
cur_cu._function_decls.extend(decls_static)
cur_cu._assign_overload_flag_to_func_decls()
cur_cu.graph_inited = True
else:
Expand Down
2 changes: 1 addition & 1 deletion version.txt
@@ -1 +1 @@
0.4.1
0.4.2

0 comments on commit 52b2c87

Please sign in to comment.