Description
Version and Platform (required):
- Binary Ninja Version: 5.1.7422-dev Ultimate (84083554)
- OS: Debian Linux
- OS Version: unstable
- CPU Architecture: x86_64
Bug Description:
The type annotations for TypeParserResult
do not match what I get at runtime. According to:
binaryninja-api/python/typeparser.py
Line 139 in 7034620
types
, variables
, and functions
are lists, but in reality they're dicts. The annotations for BasicTypeParserResult
at binaryninja-api/python/typeparser.py
Line 127 in 7034620
This causes mypy and pyright to issue complains when I try to access the TypeParserResult
fields:
error: "List[ParsedType]" has no attribute "keys"
Steps To Reproduce:
I don't have a small enough script to repro, but you can see the mismtach in the UI python console:
>>> t = bv.parse_types_from_string("static const uint32_t test;", options=["-x", "c", "--std", "c99"])
>>> type(t)
<class 'binaryninja.typeparser.TypeParserResult'>
>>> type(t.types)
<class 'dict'>
>>> type(t.variables)
<class 'dict'>
>>> type(t.functions)
<class 'dict'>
I can put together a script if that would be useful.
Expected Behavior:
No complains from mypy/pyright with code such as:
t = bv.parse_types_from_string("static const uint32_t test;", options=["-x", "c", "--std", "c99"])
if 'test' in t.keys():
print("it works")
Screenshots/Video Recording:
N/A
Binary:
N/A
Additional Information:
N/A