mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove the assertion against functions bound to types for which should not be possible
- The list was wrong - we do support string and int literals - The assertion was meant to guard against silently skipping over types for which there is no special handling. The current code handles everything in a generic way though and likely will not have to be adjusted for newly added types so the risk of that happening is low.
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
library L {
|
||||
function double(uint a) internal pure returns (uint) {
|
||||
return a * 2;
|
||||
}
|
||||
|
||||
function double(bytes memory a) internal pure returns (bytes memory) {
|
||||
return bytes.concat(a, a);
|
||||
}
|
||||
}
|
||||
|
||||
contract C {
|
||||
using L for *;
|
||||
|
||||
function double42() public returns (uint) {
|
||||
return 42.double();
|
||||
}
|
||||
|
||||
function doubleABC() public returns (bytes memory) {
|
||||
return "abc".double();
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// double42() -> 84
|
||||
// doubleABC() -> 0x20, 6, "abcabc"
|
||||
Reference in New Issue
Block a user