Strange "overflow" error

How on earth can the following line cause an “overflow” error at runtime?

var TestVal1:System.UInt32 = 0xFFFF<<16;

But if I change it to 0x7FFF<<16 it works - as if it thinks it’s dealing with a signed int although UInt is supposed to store unsigned ints.
What the dickens is going on?

I’ll answer my own question in case someone else runs up against a similar problem: you need to make sure the stuff on the right side of the equation has been defined as a uint first, otherwise Unity assumes it’s signed.