Bug in C# compiler - InvalidProgramException, Basic Syntax
Re: Bug in C# compiler - InvalidProgramException, Basic Syntax
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?
Re: Bug in C# compiler - InvalidProgramException, Basic Syntax
Quote:
: 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.
Re: Bug in C# compiler - InvalidProgramException, Basic Syntax
The point is not to make it work. The point is why compiler allows it and maybe some more meaningful exception should be thrown?
Re: Bug in C# compiler - InvalidProgramException, Basic Syntax
Quote:
Originally Posted by
lukaszg
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: