private Expression DispatchFailback(SymbolTable symbols)
{
// Default constructor of value types
if (this.DispatchType.HasFlag(DispatchTypes.Constructor)
&& ((TypeCandidateExpression) this._left).ElectedType.IsValueType
&& this.Arguments.IsEmpty()
)
{
return Default(((TypeCandidateExpression) this._left).ElectedType);
}
// Cast Operation
else if (this.DispatchType.HasFlag(DispatchTypes.Constructor)
&& ((TypeCandidateExpression) this._left).ElectedType != null
&& this.Arguments.Count == 1)
{
return Convert(
this.Arguments
.Single()
.Reduce(symbols),
((TypeCandidateExpression) this._left).ElectedType
);
}
else
{
throw new ParseException("Dispatch failed: " + this, this);
}
}