当将 long 文字分配给 ulong 时,long 类型不能隐式转换为 ulong type.But 它编译时没有错误

The long type is not implicitily convertible to ulong type.But when long literal is assigned to ulong it compiles without an error

long x =90;

ulong u = x;

//错误,因为 long 不能隐式转换为 ulong

但是,ulong u =90L; //尽管 90L 是 long 类型,但仍会编译。

有人可以解释一下这个歧义吗?

根据 MSDN ... "When you use the suffix L, the type of the literal integer is determined to be either long or ulong according to its size."

因此,“90L”可以隐式转换为 long 或 ulong,但不能将 long 隐式转换为 ulong。