Skip to content

Commit

Permalink
DEV: raise not implemented error on top level stringified type hint (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcar17 committed Jun 28, 2024
1 parent 3ee2332 commit dc86855
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/cogent3/app/composable.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,21 @@ def _get_raw_hints(main_func, min_params):
if depth > 2:
raise TypeError(msg.format("return_type", return_type, depth))

if isinstance(first_param_type, str):
msg = (
"Apps do not yet support string type hints "
"(such as those caused by __future__ annotations). "
f"Bad type hint: {first_param_type}"
)
raise NotImplementedError(msg)
if isinstance(return_type, str):
msg = (
"Apps do not yet support string type hints "
"(such as those caused by __future__ annotations). "
f"Bad type hint: {return_type}"
)
raise NotImplementedError(msg)

return first_param_type, return_type


Expand Down

0 comments on commit dc86855

Please sign in to comment.