Commit 03ef958a authored by Nsukami Patrick's avatar Nsukami Patrick
Browse files

Fix Argument 1 to "__call__" of "TranslationFunction" has incompatible type

There is some cases where the `get_description` method will return None.
The TranslationFunction assume the first parameter will be a string, not None.

Alternative solutions:
- update the condition: vtype is not None and != "Any" (picked solution)
- assert returned value is not None whenever necessary
- update TranslationFunction signature to take first parameter as Optional[str].
- update all the `get_description` methods to always return a str.
parent 947a89a37413
Pipeline #88551 failed with stages
in 4 minutes and 41 seconds
......@@ -159,7 +159,7 @@ class OperatorExpressionMixin:
# "OperatorExpressionMixin" has no attribute "iget_nodes" [attr-defined]
for vref in self.iget_nodes(VariableRef): # type:ignore[attr-defined]
vtype = vref.get_description(mainindex, tr)
if vtype != "Any":
if vtype is not None and vtype != "Any":
description = tr(vtype)
return description
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment