Description
Solidity parser accepts >>>
and >>>=
as valid operators. They're also present in the grammar. Looks like they have been present ever since the shift operators were introduced (#1487). They are, however, not documented and seem to be deliberately disabled:
solidity/libsolidity/ast/Types.cpp
Lines 576 to 578 in 9ff6d26
The operators seem to have been meant to handle unsigned right shift (SHR
), as opposed to >>
, which performs a signed right shift (SAR
). Note that both were introduced at the same time, in the constantinople
EVM.
It's been a long time (>9 years) since the shift operators were added and I don't remember anyone actually requesting them or reporting them as broken so we should probably just remove this bit of legacy. But enabling and properly documenting them would not hurt either.
For the time being it would also be clearer to reject them with a proper error message (disabled? unimplemented? dangerous?) rather than make them incompatible with all types, which must be very confusing to anyone who encounters them (it was for me).