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 6092523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:27:09+00:00 2026-05-23T12:27:09+00:00

You may consider this a bug report, however I’m curious if I am terribly

  • 0

You may consider this a bug report, however I’m curious if I am terribly wrong here, or if there is an explanation from Eric or someone else at Microsoft.

Update

This is now posted as a bug on Microsoft Connect.

Description

Consider the following class:

class A 
{
    public object B {
        set { }
    }
}

Here, A.B is a write-only but otherwise fine property.
Now, imagine we assign it inside of expression:

Expression<Func<A>> expr = 
    () => new A {
        B = new object { }
    };

This code makes C# compiler (both 3.5.30729.4926 and 4.0.30319.1) spit out

Internal Compiler Error (0xc0000005 at address 013E213F): likely culprit is ‘BIND’.

and crash.

However, merely replacing object initializer syntax ({ }) with a constructor (( )) compiles just fine.

Full code for reproduction:

using System;
using System.Linq.Expressions;

class Test {
    public static void Main()
    {
        Expression<Func<A>> expr = 
            () => new A {
                B = new object { }
            };
    }
}

class A {
    public object B { set { } }
}

(And yes, I did hit it working on a real project.)

  • 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-23T12:27:09+00:00Added an answer on May 23, 2026 at 12:27 pm

    I’m afraid I’m not Eric Lippert (Oh, but could I be so dashing…), but as a former Visual Studio languages guy who can still search the sources, I can say two things about this:

    1. Any time you see something that starts with “Internal Compiler Error” you have most definitely found a bug. That’s what that error exists for, whether it’s the C#, VB or C++ compiler. It’s the “Oh, s**t, something just went really unexpectedly wrong!” throw-up-our-hands-and-bail-out error.

    2. Beyond that, this is definitely a bug in the C# compiler that should be reported. The code that’s crashing is assuming that when you’re doing an initializer on a property that there’s a getter it can look at and, hey, guess what? In this case, there isn’t. Oddly enough, if I change the type being constructed to some type “C” instead of “object”, I don’t get the crash, so I’m guessing it’s a failure further up the stack (i.e. the code never should have gotten down to the point where it was looking for the property getter).

    Hope this helps.

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

Sidebar

Related Questions

This may seem a very silly question. Consider this: I have a simple Boolean
Let's consider this header: REBOL [ Title: Rebodex Date: 23-May-2010 Version: 2.1.1 File: %rebodex.r
Some may or may not consider this a complex statement, but for me (since
This may seem like a silly question, so bear with me... Consider this REPL
Consider this the complete form of the question in the title: Since OpenCL may
It may not be so obvious how respond_to? works in ruby. Consider that: class
may i know how to use this getMicrophone with simpleFLVWriter to create flv with
may i know how to copy xml files from rc/ to class/ when compile
Consider this scenario. I have some business logic that now and then will be
Consider this code for loading, modifying and saving a Bitmap image: using (Bitmap bmp

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.