/// <remarks>
        /// Similar to SymbolExtensions.GetMemberTypeParameters, but returns empty for unsupported symbols.
        /// </remarks>
        private static ImmutableArray<TypeParameterSymbol> GetTypeParameters(Symbol symbol)
        {
            switch (symbol.Kind)
            {
                case SymbolKind.Method:
                case SymbolKind.NamedType:
                case SymbolKind.ErrorType:
                    return symbol.GetMemberTypeParameters();
            }

            return ImmutableArray<TypeParameterSymbol>.Empty;
        }