Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion toolchain/mfc/params/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ def register(self, param: ParamDef) -> None:
if param.name in self._params:
existing = self._params[param.name]
if existing.param_type != param.param_type:
raise ValueError(f"Type mismatch for '{param.name}'")
raise ValueError(
f"Type mismatch for '{param.name}': "
f"existing type is {existing.param_type!r}, "
f"new type is {param.param_type!r}"
)
existing.tags.update(param.tags)
for tag in param.tags:
self._by_tag[tag].add(param.name)
Expand Down
3 changes: 2 additions & 1 deletion toolchain/mfc/params_tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def test_register_type_mismatch_raises(self):
with self.assertRaises(ValueError) as ctx:
reg.register(ParamDef(name="test", param_type=ParamType.REAL))

self.assertIn("Type mismatch", str(ctx.exception))
self.assertIn("existing type is", str(ctx.exception))
self.assertIn("new type is", str(ctx.exception))

def test_get_params_by_tag(self):
"""get_params_by_tag should return params with that tag."""
Expand Down
Loading