[Mono-dev] Bug in compiler?

Steve Bjorg steveb at mindtouch.com
Sun Mar 11 22:28:56 EDT 2007


The correct error message should be:
	Keyword 'this' is not available in the current context


Jerry,

You cannot pass the reference to an unconstructed object.  Using  
'this' in this fashion is illegal, because that Path instance has not  
yet been initialized.


Cheers,

- Steve

---------------------------------
Steve G. Bjorg

MindTouch
555 W. Beech St.
Suite 501
San Diego, CA 92101

619.795.8459 office
619.795.3948 fax
425.891.5913 mobile



On Mar 11, 2007, at 7:00 PM, Jerry Haltom wrote:

> public Path(Node startingNode)
> 	: this(new InitialStep(this, startingNode))
> {
>
> }
>
>
> I have that code as a ctor in a class. Nothing special that I can see
> about it. Basically just calling another ctor to do some work.
>
> Keyword `this' is not valid in a static property, static method, or
> static field initializer(CS0026)
>
> That is what I get when compiling it.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>




More information about the Mono-devel-list mailing list