Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typedef overwriting issue #2

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion pyangbind/plugin/pybind.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,18 @@ def build_elemtype(ctx, et, prefix=False):
# at this point. In the case that we are referencing a type that is a
# typedef, then this has been added to the class_map.
try:
elemtype = class_map[et.arg]
# Always prepare prefix
# if type has no prefix, use local prefix
# TODO: change class_map to use module name instead of prefix, as prefix can be over-written
# TODO: once the class_map is changed, modify below logic to use mod name instead of prefix
# TODO: remove prefix as an argument in build_type. I dont see any logic here.
t_prefix = et.i_module.i_prefix
if ":" in et.arg:
t_prefix = et.arg.split(":")
key_str = f"{t_prefix}:{et.arg}"
if key_str not in class_map:
key_str = et.arg
elemtype = class_map[key_str]
except KeyError:
passed = False
if prefix:
Expand Down