Defaul data location for type conversions is memory.

This commit is contained in:
chriseth
2018-08-13 14:38:12 +02:00
parent a2c754b3fe
commit bd567a22c9
5 changed files with 14 additions and 5 deletions
@@ -0,0 +1,5 @@
contract test {
function f() public pure returns (bytes) {
return bytes("abc");
}
}
@@ -2,4 +2,4 @@ contract C {
string s = string("\xa0\x00");
}
// ----
// TypeError: (28-46): Explicit type conversion not allowed from "literal_string (contains invalid UTF-8 sequence at position 0)" to "string storage pointer".
// TypeError: (28-46): Explicit type conversion not allowed from "literal_string (contains invalid UTF-8 sequence at position 0)" to "string memory".
@@ -4,4 +4,4 @@ contract C {
}
}
// ----
// TypeError: (52-65): Explicit type conversion not allowed from "literal_string "abc"" to "string storage pointer".
// Warning: (52-65): Statement has no effect.