using System.Collections.Immutable; using Microsoft.CodeAnalysis.CSharp.Symbols; using Microsoft.CodeAnalysis.PooledObjects; using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CSharp; internal static class SymbolInfoFactory { internal static SymbolInfo Create(ImmutableArray symbols, LookupResultKind resultKind, bool isDynamic) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) return Create(OneOrMany.Create(ImmutableArrayExtensions.NullToEmpty(symbols)), resultKind, isDynamic); } internal static SymbolInfo Create(OneOrMany symbols, LookupResultKind resultKind, bool isDynamic) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (isDynamic) { if (symbols.Count == 1) { return new SymbolInfo(symbols[0].GetPublicSymbol(), (CandidateReason)14); } return new SymbolInfo(getPublicSymbols(symbols), (CandidateReason)14); } if (resultKind == LookupResultKind.Viable) { if (symbols.Count > 0) { return new SymbolInfo(symbols[0].GetPublicSymbol()); } return SymbolInfo.None; } return new SymbolInfo(getPublicSymbols(symbols), (CandidateReason)((symbols.Count > 0) ? ((int)resultKind.ToCandidateReason()) : 0)); static ImmutableArray getPublicSymbols(OneOrMany val) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) ArrayBuilder instance = ArrayBuilder.GetInstance(val.Count); Enumerator enumerator = val.GetEnumerator(); while (enumerator.MoveNext()) { Symbol current = enumerator.Current; instance.Add(current.GetPublicSymbol()); } return instance.ToImmutableAndFree(); } } }