public override void OnSelfLiteralExpression(SelfLiteralExpression node)
{
if (null == _currentMethod)
{
Error(node, CompilerErrorFactory.SelfOutsideMethod(node));
return;
}
if (_currentMethod.IsStatic)
{
if (NodeType.MemberReferenceExpression != node.ParentNode.NodeType)
{
// if we are inside a MemberReferenceExpression
// let the MemberReferenceExpression deal with it
// as it can provide a better message
Error(CompilerErrorFactory.SelfIsNotValidInStaticMember(node));
}
}
node.Entity = _currentMethod;
node.ExpressionType = _currentMethod.DeclaringType;
}