You cannot shift 1 << 31 with a long data type to get this error.
However, this is due to the fact that 1 , as an integer literal, is considered as Int32, which is the default integer literal.
You should get around this by specifying this as:
Public Const test As ULong = 1UL << 30 Public Const test2 As ULong = 1UL << 31
The UL flag says to make 1 unsigned long. See Typical Symbols for details .
source share