public Expression CompileCast(AstCast ce) { var targetType = NameResolver.GetType(Namescope, ce.TargetType); var operand = CompileExpression(ce.Argument); return(TryCompileCast(ce.Source, targetType, operand) ?? Error(ce.Source, ErrorCode.E2029, operand.ReturnType.Quote() + " has no defined cast to type " + targetType.Quote())); }
public void WriteCast(AstCast a) { Write(a.TargetType); Write(a.Argument); }