是否有语言,.NET不支持无符号类型兼容?不支持、符号、语言、类型

2023-09-04 10:46:51 作者:啷个哩个啷

让我们说,我写在C#中的图书馆,我不知道谁去使用它。

Let's say that I'm writing a library in C# and I don't know who is going to consume it.

该库的公共接口有一些未签名的类型 - UINT,USHORT。显然,这些类型是不符合CLS和,从理论上说,有可能是语言,这将不能够使用它们。

The public interface of the library has some unsigned types - uint, ushort. Apparently those types are not CLS-compliant and, theoretically speaking, there may be languages that will not be able to consume them.

有没有在现实中的语言这样呢?

Are there in reality languages like that?

推荐答案

我相信,在VB.NET的原始版本,无符号类型都可以使用,但有内置的语言对他们的支持。这已得到解决,当然在以后的版本。

I believe in the original version of VB.NET, unsigned types were usable but there was no support for them built into the language. This has been addressed in later versions, of course.

此外,我怀疑是现已解散的J#具有无符号类型不支持(因为Java没有任何)。

Additionally, I suspect that the now-defunct J# has no support for unsigned types (given that Java doesn't have any).