Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 569481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:17:59+00:00 2026-05-13T13:17:59+00:00

Why cant I use an IEnumerable with params? Will this ever be fixed? I

  • 0

Why cant I use an IEnumerable with params? Will this ever be fixed? I really wish they would rewrite the old libraries to use generics…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:17:59+00:00Added an answer on May 13, 2026 at 1:17 pm

    Why cant I use an IEnumerable with params?

    The question presupposes that the design team must provide a reason to not add a feature to the language. This presupposition is false.

    Rather, in order for a feature to be used by you it needs to be thought of, designed, specified, implemented, tested, documented and shipped. All of these have large costs.

    The “params enumerable” feature has been thought of and designed. It has never been specified, implemented, tested, documented or shipped.

    Therefore, you cannot use the feature.


    UPDATE: As of this writing — early 2015 — has now been specified, but implementation, testing, documentation and shipping were cut for C# 6.0 in the latter part of 2014. See Lucian’s announcement here: http://roslyn.codeplex.com/discussions/568820.

    Since it has still not been implemented, tested, documented and shipped, there is still no such feature. Hopefully this will make it into a hypothetical future version of C#.


    UPDATE: I should clarify what I mean by “the feature” since it is possible we all have different ideas in our heads what “the feature” is. The feature I’m talking about is to allow you to say something like

    void Frob(params IEnumerable<int> x)
    {
        foreach(int y in x) ...
    }
    

    and then the call site can either be in the “normal form” of passing a sequence of integers, or the “expanded form” of Frob(10, 20, 30). If in the expanded form, the compiler generates the call as though you’d said Frob(new int[] { 10, 20, 30}), the same as it does for param arrays. The point of the feature is that it is often the case that the method never uses random access to the array, and therefore, we could weaken the requirement that the params be an array. The params could just be a sequence instead.

    You can do this today by making an overload:

    void Frob(params int[] x) { Frob((IEnumerable<int>)x); }
    
    void Frob(IEnumerable<int> x)
    {
        foreach(int y in x) ...
    }
    

    which is a bit of a pain. We could simply allow you to use IEnumerable as the type of the params argument and be done with it.

    Will this ever be fixed?

    I hope so. This feature has been on the list for a long time. It would make a lot of functions work much more nicely with LINQ.

    Frob(from c in customers select c.Age);
    

    without having to write two different versions of Frob.

    However, it is a mere “small convenience” feature; it doesn’t actually add a whole lot of new power to the language. That’s why its never made it high enough on the priority list to make it to the “specification is written” stage.

    I really wish they would rewrite the old libraries to use generics.

    Comment noted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 308k
  • Answers 308k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer How can I commit the change for test() only, and… May 13, 2026 at 9:50 pm
  • Editorial Team
    Editorial Team added an answer I would like to know workaround too In the meantime… May 13, 2026 at 9:50 pm
  • Editorial Team
    Editorial Team added an answer Try this: $('[id^=ExpiryDate]').each(function() { var id = $(this).attr('id').replace('ExpiryDate',''); $(this).rules('add', {… May 13, 2026 at 9:50 pm

Related Questions

I'm trying to show someone a use for interfaces in a crazy situation they've
I want to get the distinct values in a list, but not by the
I keep hearing that in .net 3.5 you should use IEnumerable over a List,
I typically use extension methods very sparingly. When I do feel compelled to write
Why can't I use this interface to create a strongly typed view? public interface

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.