为什么运行时显示的一般类型为" GenericType`n"? [英] Why does the runtime shows the generic types as "GenericType`n"?

查看:125
本文介绍了为什么运行时显示的一般类型为" GenericType`n"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

和为何它没有显示真正的类型(如:目录<字符串>将代替List`1)?
哪里这种奇怪的(对我来说)符号从何而来?

And why doesn't it shows the real type (eg: List<string> instead of List`1)?
Where does this strange (to me) notation comes from?

推荐答案

在'1 MSIL语法泛型类型 - 名单,其中,T&GT; 是C#特异性。更多MSIL的例子:

The `1 is MSIL syntax for a generic type - List<T> is C#-specific. More MSIL examples:

List<T> == System.Collections.Generic.List`1

List<string> == System.Collections.Generic.List`1[System.String]

Dictionary<string, int> == 
   System.Collections.Generic.Dictionary`2[System.String, System.Int32]

这篇关于为什么运行时显示的一般类型为&QUOT; GenericType`n&QUOT;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆