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; } }
protected virtual TypeWithModifiers SubstituteTypeParameter(TypeParameterSymbol typeParameter) { return new TypeWithModifiers(typeParameter); }
internal bool Equals(TypeParameterSymbol other) { return(Equals(other, false, false)); }
protected virtual TypeWithModifiers SubstituteTypeParameter(TypeParameterSymbol typeParameter) { return(new TypeWithModifiers(typeParameter)); }
internal void Add(TypeParameterSymbol key, TypeWithModifiers value) { this.Mapping.Add(key, value); }
internal void Add(TypeParameterSymbol key, TypeWithModifiers value) { this.Mapping.Add(key, value); }
internal static Cci.IGenericParameterReference Translate(TypeParameterSymbol param) { if (!param.IsDefinition) throw new InvalidOperationException(/*string.Format(CSharpResources.GenericParameterDefinition, param.Name)*/); return param; }