コード例 #1
0
        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()));
        }
コード例 #2
0
 public void WriteCast(AstCast a)
 {
     Write(a.TargetType);
     Write(a.Argument);
 }