Default argument of generic type, instantiated to int is 'null' according to Intellisense
Out of curiosity, is the following a bug or intended behavior? It seems IMHO strange that the def开发者_高级运维ault argument of an integer parameter is null
.
This could be your IDE displaying it improperly; if the code compiles properly, you might want to print the argument in that function, to ensure that you're getting the default value that you expect.
I would be willing to bet that it is functioning as intended.
On my computer, VS Professional 2010, targeting .Net 4.0, it has the correct information int arg = Default(T)
. So, I suppose you are not going crazy :)
精彩评论