0
考虑这个层次结构:如何通过派生类型传递Mono Cecil中的基类型的类型参数?
class StrDict<T> : Dictionary<string, T>
class MyDictionary : StrDict<double>
我想使用单声道塞西尔替换基本类型名称T
类型double
。理想情况下,我想直接获取StrDict
`1 <double>
,而没有解决方法。
我想:
var baseTypeDef = ((GenericInstanceType) myDictTypeRef.BaseType).ElementType.Resolve();
var typeParamName = baseTypeDef.GenericParameters.First().FullName
但它返回T
,不double
。