Open hbrunie opened 1 month ago
With lastest Psyclone version, commit: dd3500065286e05756250f47ec9913f3ffd0a4e5
the error is now:
../../psyclone/psyclone/src/psyclone/psyir/transformations/reference2arrayrange_trans.py:190: in apply
indices.append(Range.create(lbound, ubound, step))
../../psyclone/psyclone/src/psyclone/psyir/nodes/ranges.py:130: in create
erange.stop = stop
../../psyclone/psyclone/src/psyclone/psyir/nodes/ranges.py:222: in stop
self._check_valid_input(value, "stop")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
value = <Extent.ATTRIBUTE: 2>, name = 'stop'
@staticmethod
def _check_valid_input(value, name):
'''
Perform checks that the supplied value is valid as a child of a
Range node.
:param object value: entity to check.
:param str name: the name of the quantity for which this value has \
been supplied.
:raises TypeError: if the supplied value is not a sub-class of Node.
:raises TypeError: if the supplied value is a Literal but is not of \
INTEGER type.
'''
if not isinstance(value, Node):
> raise TypeError(
f"The {name} value of a Range must be a sub-class of "
f"Node but got: {type(value).__name__}")
E TypeError: The stop value of a Range must be a sub-class of Node but got: Extent
../../psyclone/psyclone/src/psyclone/psyir/nodes/ranges.py:153: TypeError
Here is the code snippet to highlight the bug
Here is the message of error I got:
Here is the code snippet I wrote in
reference2arrayrange_trans.py
line 108 to avoid the bug:The corresponding git patch I made: