Exemple #1
0
 private InterpretedType NewIntepretedArrayType(NonRuntimeType elementType, GenericScope genericScope)
 {
     return(new InterpretedArrayType(
                elementType,
                new Lazy <Type[]>(() => GetArrayInterfaces(elementType, genericScope)),
                t => Empty <ILazyMember <MemberInfo> > .Array
                ));
 }
Exemple #2
0
        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)
            });
        }
Exemple #3
0
        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;
        }
Exemple #4
0
 public CilinArrayIterator(CilinArray array, NonRuntimeType iteratorType)
 {
     _array        = array;
     _iteratorType = iteratorType;
 }