阴影(VB.NET)和新之间的差异(C#)
从一个头脑简单的简单问题:
哪些之间的差异在VB.NET阴影
关键字和新建关键字? (关于当然方法签名)。
Simple question from a simple-minded:
What are the differences between the Shadows
keyword in VB.NET and the New
keyword in C#? (regarding method signatures of course).
他们是相同的。的 阴影
是VB.NET相当于C#的的 新
关键字。它们的意思是一样的语义,它们向下编译到相同的IL。
They are identical. Shadows
is the VB.NET equivalent for C#'s new
keyword. They mean the same thing semantically and they compile down to the same IL.
在Visual Studio中的某些版本(我不知道这是否仍是如此),使用在VB.NET工程阴影
关键字隐藏了所有的功能与智能感知名称相同的效果。但是,这实际上不是一个语言功能;如果它的设计还是在智能感知的实现中的错误它甚至没有明确。如果从C#应用程序使用同一个VB.NET库,你会看到所有的方法,如果他们用新
。
In some versions of Visual Studio (I'm not sure if this is still the case), using the Shadows
keyword in a VB.NET project had the effect of hiding all functions with the same name from Intellisense. But that's not actually a language feature; it's not even clear if it's by design or a bug in the implementation of Intellisense. If you use the same VB.NET library from a C# application, you'll see all of the methods as if they were declared with new
.