Commit 19f6e4a4 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Declare FieldShapeSymbol and FieldStrideSymbol as strictly positive

parent 6942ed0b
......@@ -105,8 +105,8 @@ class TypedSymbol(sp.Symbol):
obj = TypedSymbol.__xnew_cached_(cls, *args, **kwds)
return obj
def __new_stage2__(cls, name, dtype):
obj = super(TypedSymbol, cls).__xnew__(cls, name)
def __new_stage2__(cls, name, dtype, *args, **kwargs):
obj = super(TypedSymbol, cls).__xnew__(cls, name, *args, **kwargs)
obj._dtype = create_type(dtype)
except (TypeError, ValueError):
......@@ -30,7 +30,7 @@ class FieldStrideSymbol(TypedSymbol):
def __new_stage2__(cls, field_name, coordinate):
name = "_stride_{name}_{i}".format(name=field_name, i=coordinate)
obj = super(FieldStrideSymbol, cls).__xnew__(cls, name, STRIDE_DTYPE)
obj = super(FieldStrideSymbol, cls).__xnew__(cls, name, STRIDE_DTYPE, positive=True)
obj.field_name = field_name
obj.coordinate = coordinate
return obj
......@@ -55,7 +55,7 @@ class FieldShapeSymbol(TypedSymbol):
def __new_stage2__(cls, field_names, coordinate):
names = "_".join([field_name for field_name in field_names])
name = "_size_{names}_{i}".format(names=names, i=coordinate)
obj = super(FieldShapeSymbol, cls).__xnew__(cls, name, SHAPE_DTYPE)
obj = super(FieldShapeSymbol, cls).__xnew__(cls, name, SHAPE_DTYPE, positive=True)
obj.field_names = tuple(field_names)
obj.coordinate = coordinate
return obj
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