mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallowing shifts by signed types
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
function f(int256 a, int256 b) public returns (int256) {
|
||||
return a >> b;
|
||||
}
|
||||
function g(int256 a, int256 b) public returns (int256) {
|
||||
return a >> (256 - b);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError: (89-95): Operator >> not compatible with types int256 and int256
|
||||
// TypeError: (179-193): Operator >> not compatible with types int256 and int256
|
||||
Reference in New Issue
Block a user