This is a purely academic question - I have found a getaround easily enough.
While porting a VB.Net class to C#, I came upon the declaration of a field in a class which used the this keyword as a parameter in a new() statement. The compiler said the "Keyword 'this' is not available in the current context' (the VB compiler saw no problem with this state of affairs). I easily got around this by moving the field's initialization to the contructor of the class.
edit: after reading comments, I added the following code block
public class cTransactions
{
private List Trans = new List();
private List Archive = new List();
private cDDs Debits = new cDDs(this); // complier error
//Keyword 'this' is not available in the current context
private string path = Directory.GetCurrentDirectory() + "\";
private bool dirty = false;
private int LastID;
// followed by Property declarations, ctor, methods etc.
//...
}
However, I cannot find any reference to the keyword 'this' not being available before the execution of a class' constructor (though I may have missed that revelation in the 500+ pages of the language specification). Is this the case or should I be looking some error in one of the lines prior to the field declaration?