This works nicely:
Public Const test As ULong = 1 << 30
This doesn’t work nicely:
Public Const test As ULong = 1 << 31
It creates this error:
Constant expression not representable in type ‘ULong’
How do I make it work?
This does work:
Public Const test As Long = 1 << 31
But I have to use ULong.
Try the following:
You need to explicitly tell the compiler you are doing the operation on a
ULong.The C# equivalent works: