private static Type Instantiate(this Type type, SigTypeContext context) { if (type.IsGenericParameter) { int position = type.GenericParameterPosition; if (type.DeclaringMethod != null) { return(context.MethodInstantiation[position]); } else { Debug.Assert(type.DeclaringType != null); return(context.TypeInstantiation[position]); } } if (type.ContainsGenericParameters) { // // Note we can come here for both generic and non-generic types. Consider this example: // // interface IFoo<T> { } // class Foo<U> : IFoo<U[]> { } // // var foo = typeof(Foo<>); // var ifoo = foo.ImplementedInterfaces.First(); // var arg = ifoo.GetGenericArguments()[0]; // // arg.ContainsGenericParameters will be true, but arg.IsGenericType will be false. // return(new InstantiatedTypeInfo(type, context)); } return(type); }
private static Type GetNullableType(this Type type) { Debug.Assert(type.IsNullable()); Type[] arguments = type.GetGenericArguments(); Debug.Assert(arguments.Length == 1); return(arguments[0]); }
public override Type[] GetNestedTypes(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override MethodInfo[] GetMethods(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override Type GetGenericTypeDefinition() { Debug.Assert(false); throw NotImplemented.ByDesign; }
protected override bool IsPrimitiveImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; }
protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override int GetArrayRank() { Debug.Assert(false); throw NotImplemented.ByDesign; }
public sealed override Type MakePointerType() { Debug.Assert(false); throw NotImplemented.ByDesign; }
public sealed override Type MakeGenericType(params Type[] instantiation) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public sealed override Type MakeArrayType(int rank) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override Type[] GetGenericParameterConstraints() { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override Type MakeByRefType() { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override bool IsDefined(Type attributeType, bool inherit) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override Type GetElementType() { Debug.Assert(false); throw NotImplemented.ByDesign; }
protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
protected override bool IsCOMObjectImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override object[] GetCustomAttributes(Type attributeType, bool inherit) { Debug.Assert(false); throw NotImplemented.ByDesign; }
protected override bool HasElementTypeImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override FieldInfo GetField(string name, BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override Type GetInterface(string name, bool ignoreCase) { Debug.Assert(false); throw NotImplemented.ByDesign; }
public override Type[] GetInterfaces() { Debug.Assert(false); throw NotImplemented.ByDesign; }