Inheritance: Microsoft.Cci.IGenericParameterReference, Microsoft.Cci.IGenericMethodParameterReference, Microsoft.Cci.IGenericTypeParameterReference, Microsoft.Cci.IGenericParameter, Microsoft.Cci.IGenericMethodParameter, Microsoft.Cci.IGenericTypeParameter
        protected sealed override TypeWithModifiers SubstituteTypeParameter(TypeParameterSymbol typeParameter)
        {
            // It might need to be substituted directly.
            TypeWithModifiers result;
            if (Mapping.TryGetValue(typeParameter, out result))
            {
                return result;
            }

            return new TypeWithModifiers(typeParameter);
        }
        internal SubstitutedTypeParameterSymbol(Symbol newContainer, TypeMap map, TypeParameterSymbol substitutedFrom)
        {
            _container = newContainer;
            // it is important that we don't use the map here in the constructor, as the map is still being filled
            // in by TypeMap.WithAlphaRename.  Instead, we can use the map lazily when yielding the constraints.
            _map = map;
            _substitutedFrom = substitutedFrom;
#if DEBUG_ALPHA
            _mySequence = _nextSequence++;
#endif
        }
        private static void GrowPool(int count)
        {
            var initialPool = s_parameterPool;
            while (count > initialPool.Length)
            {
                var newPoolSize = ((count + 0x0F) & ~0xF); // grow in increments of 16
                var newPool = new TypeParameterSymbol[newPoolSize];

                Array.Copy(initialPool, newPool, initialPool.Length);

                for (int i = initialPool.Length; i < newPool.Length; i++)
                {
                    newPool[i] = new IndexedTypeParameterSymbol(i);
                }

                Interlocked.CompareExchange(ref s_parameterPool, newPool, initialPool);

                // repeat if race condition occurred and someone else resized the pool before us
                // and the new pool is still too small
                initialPool = s_parameterPool;
            }
        }
Example #4
0
 protected virtual TypeWithModifiers SubstituteTypeParameter(TypeParameterSymbol typeParameter)
 {
     return new TypeWithModifiers(typeParameter);
 }
 internal bool Equals(TypeParameterSymbol other)
 {
     return(Equals(other, false, false));
 }
Example #6
0
 protected virtual TypeWithModifiers SubstituteTypeParameter(TypeParameterSymbol typeParameter)
 {
     return(new TypeWithModifiers(typeParameter));
 }
Example #7
0
 internal void Add(TypeParameterSymbol key, TypeWithModifiers value)
 {
     this.Mapping.Add(key, value);
 }
Example #8
0
 internal void Add(TypeParameterSymbol key, TypeWithModifiers value)
 {
     this.Mapping.Add(key, value);
 }
Example #9
0
        internal static Cci.IGenericParameterReference Translate(TypeParameterSymbol param)
        {
            if (!param.IsDefinition)
                throw new InvalidOperationException(/*string.Format(CSharpResources.GenericParameterDefinition, param.Name)*/);

            return param;
        }