private InterpretedType NewIntepretedArrayType(NonRuntimeType elementType, GenericScope genericScope) { return(new InterpretedArrayType( elementType, new Lazy <Type[]>(() => GetArrayInterfaces(elementType, genericScope)), t => Empty <ILazyMember <MemberInfo> > .Array )); }
public Type[] GetArrayInterfaces(NonRuntimeType elementType, GenericScope genericScope) { var elementTypeArray = new[] { elementType }; return(new Type[] { typeof(IEnumerable), typeof(ICollection), typeof(IList), GenericPathType(null, typeof(IEnumerable <>), TypeSupport.Definitions.IEnumerableOfT, elementTypeArray, false, genericScope), GenericPathType(null, typeof(IReadOnlyCollection <>), TypeSupport.Definitions.IReadOnlyCollectionOfT, elementTypeArray, false, genericScope), GenericPathType(null, typeof(ICollection <>), TypeSupport.Definitions.ICollectionOfT, elementTypeArray, false, genericScope), GenericPathType(null, typeof(IReadOnlyList <>), TypeSupport.Definitions.IReadOnlyListOfT, elementTypeArray, false, genericScope), GenericPathType(null, typeof(IList <>), TypeSupport.Definitions.IListOfT, elementTypeArray, false, genericScope) }); }
public ObjectTypeOverride(object @object, NonRuntimeType type) { if (@object is INonRuntimeObject) { throw new ArgumentException($"Attempted to override type twice ({@object})."); } if (TypeSupport.GetTypeOf(@object) == type) { throw new ArgumentException($"Attempted to override type for {@object} that already has type {type}."); } Type = Argument.NotNull(nameof(type), type); Object = @object; }
public CilinArrayIterator(CilinArray array, NonRuntimeType iteratorType) { _array = array; _iteratorType = iteratorType; }