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

  • SEARCH
  • Home
  • 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 6126179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:20:24+00:00 2026-05-23T16:20:24+00:00

I was recently browsing this question here on StackOverflow, and looking at the accepted

  • 0

I was recently browsing this question here on StackOverflow, and looking at the accepted answer I wonder what is the actual, concrete type of

var ordinals = new {
                       Test1 = SomeFunctionReturningInt32("Test1"),
                       Test2 = SomeFunctionReturningInt32("Test2")
                   };

What does this get MSILed to?

  • 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-23T16:20:24+00:00Added an answer on May 23, 2026 at 4:20 pm

    It gets compiled into a generic internal type within your assembly. Something like:

    internal sealed class SomeCompilerGeneratedNameHere<T1, T2>
    {
        public SomeCompilerGeneratedNameHere(T1 test1, T2 test2)
        {
            ...
        }
    
        public T1 Test1 { get { ... } }
        public T2 Test2 { get { ... } }
    
        // Overrides for Equals, ToString, GetHashCode
    }
    

    Then in your case, it would use SomeCompilerGeneratedNameHere<int, int>. (The name itself is an “unspeakable” name, so you can’t refer to it within your code explicitly, and there won’t be any naming clashes with valid C# types.)

    I can’t remember offhand whether the constructor and properties are actually public or whether they’re internal too – I know the type itself is internal.

    All anonymous types with the same property names in the same order will use the same generic type, just potentially with different type parameters.

    Note that this is implementation-specific – I don’t believe the specification guarantees that generic types will be used; there could be one type per anonymous type used. The spec does guarantee that two anonymous type creation expressions will use the same type if they have the same property names and types in the same order.

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

Sidebar

Related Questions

This may be a basic question, but I'm still looking for the answer. I've
Recently I was confused by this question . Maybe because I didn't read language
Recently I asked this question: Find Common Values in several arrays, or lists VB.NET
Recently I found a pretty graph when I was browsing the adminskins at ThemeForest
Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's
Recently, I was browsing through my copy of the C++ Pocket Reference from O'Reilly
Firstly, I realise that this is a very similar question to this one: Which
I recently was browsing a local web design firm's portfolio and found all their
Recently moved from svn to git, pardon my newbie question. In our release process,
I recently discovered the Emacs code browsing package (ECB) and it seems to be

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.