Skip to content
Snippets Groups Projects
Commit e0a3c928 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Add assertion that second argument of cast_func is of type pymbolics.data_type.Type

parent 9b9a4b54
Branches
Tags
No related merge requests found
Pipeline #16688 failed with stage
in 3 minutes and 17 seconds
......@@ -54,6 +54,7 @@ class cast_func(sp.Function):
# rhs = cast_func(0, 'int')
# print( sp.Ne(lhs, rhs) ) # would give true if all cast_funcs are booleans
# -> thus a separate class boolean_cast_func is introduced
assert isinstance(args[1], Type), "Second argument of cast_func must be of type pymbolics.data_type.Type"
if isinstance(args[0], Boolean):
cls = boolean_cast_func
return sp.Function.__new__(cls, *args, **kwargs)
......
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