Skip to content

Commit

Permalink
Add the ability to have a tree_type when we send method info metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
gordonwatts committed Mar 25, 2024
1 parent f35057b commit 96ad4ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
6 changes: 5 additions & 1 deletion func_adl_xAOD/common/meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ def process_metadata(
if "return_type" in md:
# Single return type
type_info = parse_type(md["return_type"])
term = terminal(type_info.name, p_depth=type_info.pointer_depth)
term = terminal(
type_info.name,
p_depth=type_info.pointer_depth,
tree_type=md.get("tree_type", None),
)
else:
type_info_element = parse_type(md["return_type_element"])
type_info_collection = (
Expand Down
19 changes: 19 additions & 0 deletions tests/common/test_meta_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ def test_md_method_type_double():
assert t.deref_depth == 0


def test_md_method_type_double_tree_type():
"Make sure a double can be set"
metadata = [
{
"metadata_type": "add_method_type_info",
"type_string": "my_namespace::obj",
"method_name": "pT",
"return_type": "double",
"tree_type": "int",
}
]

process_metadata(metadata)

t = method_type_info("my_namespace::obj", "pT")
assert t is not None
assert t.r_type.tree_type.type == "int"


def test_md_method_type_double_deref():
"Make sure a double can be set"
metadata = [
Expand Down

0 comments on commit 96ad4ef

Please sign in to comment.