Commit f625b114 authored by Stefan Behnel's avatar Stefan Behnel

Fix memoryview assignment from const view to const view.

parent c7265455
......@@ -786,8 +786,12 @@ class MemoryViewSliceType(PyrexType):
return False
src_dtype, dst_dtype = src.dtype, dst.dtype
if dst_dtype.is_const and not src_dtype.is_const:
if dst_dtype.is_const:
# Requesting read-only views is always ok => consider only the non-const base type.
dst_dtype = dst_dtype.const_base_type
if src_dtype.is_const:
# When assigning between read-only views, compare only the non-const base types.
src_dtype = src_dtype.const_base_type
if src_dtype != dst_dtype:
return False
......
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