mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4777 from ethereum/typeConversionMemory
Defaul data location for type conversions is memory.
This commit is contained in:
@@ -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".
|
||||
|
||||
+1
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user