diff options
author | chriseth <c@ethdev.com> | 2015-06-23 20:55:33 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-06-24 18:18:19 +0800 |
commit | 1add48a652ea695032d8c664fad3ea84afbfb9ea (patch) | |
tree | 1410f848aeaf32b61d7745999c85334275151338 /Types.cpp | |
parent | fd1a01bbce5b5b6491e05b87fb183a55e9804f4e (diff) | |
download | dexon-solidity-1add48a652ea695032d8c664fad3ea84afbfb9ea.tar.gz dexon-solidity-1add48a652ea695032d8c664fad3ea84afbfb9ea.tar.zst dexon-solidity-1add48a652ea695032d8c664fad3ea84afbfb9ea.zip |
Copy routines for non-byte arrays.
Diffstat (limited to 'Types.cpp')
-rw-r--r-- | Types.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -721,9 +721,13 @@ bool ArrayType::isImplicitlyConvertibleTo(const Type& _convertTo) const } else { - // Require that the base type is the same, not only convertible. - // This disallows assignment of nested arrays from storage to memory for now. - if (*getBaseType() != *convertTo.getBaseType()) + // Conversion to storage pointer or to memory, we de not copy element-for-element here, so + // require that the base type is the same, not only convertible. + // This disallows assignment of nested dynamic arrays from storage to memory for now. + if ( + *copyForLocationIfReference(location(), getBaseType()) != + *copyForLocationIfReference(location(), convertTo.getBaseType()) + ) return false; if (isDynamicallySized() != convertTo.isDynamicallySized()) return false; |