public override void LeaveRaiseStatement(RaiseStatement node)
{
if (node.Exception == null) return;
var exceptionType = GetExpressionType(node.Exception);
if (IsError(exceptionType))
return;
if (TypeSystemServices.StringType == exceptionType)
{
node.Exception = CodeBuilder.CreateConstructorInvocation(
node.Exception.LexicalInfo,
MethodCache.Exception_StringConstructor,
node.Exception);
}
else if (!TypeSystemServices.IsValidException(exceptionType))
{
Error(CompilerErrorFactory.InvalidRaiseArgument(node.Exception, exceptionType));
}
}