Click to See Complete Forum and Search --> : Bug in C# compiler - InvalidProgramException, Basic Syntax


lukaszg
December 16th, 2009, 08:44 AM
http://pastebin.com/f2fa07263

memeloo
December 16th, 2009, 08:46 AM
can a nested-class be derived from its parent class? and why would one want to do it? what is the purpose of doing this?

Mutant_Fruit
December 16th, 2009, 10:09 AM
: base(() => Call()) { }

That code is probably what's causing the issue. Essentially what you're trying to do is execute code in B before the constructor from B has been run. That's illegal, hence the error. I'm surprised the compiler didn't give out.

lukaszg
December 16th, 2009, 01:23 PM
The point is not to make it work. The point is why compiler allows it and maybe some more meaningful exception should be thrown?

memeloo
December 16th, 2009, 01:26 PM
The point is not to make it work. The point is why compiler allows it and maybe some more meaningful exception should be thrown?
don't you think you should have mentioned it in you first post and not just pasting some links? then you wonder that we didn't guess your intentions. :mad: