private static IImmutableList<Symbol> AddSymbols(Type type, IImmutableList<Symbol> derivedTypeSymbols) { if (type == null) return derivedTypeSymbols; var symbolFields = type.GetFields(BindingFlags.Public | BindingFlags.Static) .Where(field => SymbolType.IsAssignableFrom(field.FieldType)); var symbols = symbolFields.Select(field => (Symbol)field.GetValue(null)); return AddSymbols(type.BaseType, derivedTypeSymbols.AddRange(symbols)); }
public SorterStageImpl(int keyCount, IReadOnlyList <IKeyPair> keyPairs) { _keyCount = keyCount; _keyPairs = _keyPairs.AddRange(keyPairs.OrderBy(kp => kp.Index)); }
public INonemptyList <T> AddRange(IEnumerable <T> items) { return(_list.AddRange(items) .AsNonemptyList() .Extract(() => throw new InvalidOperationException())); }