if (leaves.size() > 1) {
int errCode = 2060;
String msg = "Expected one leaf. Found " + leaves.size() + " leaves.";
throw new TypeCheckerException(msg, errCode, PigException.BUG);
}
ExpressionOperator currentOutput = (ExpressionOperator) leaves.get(0) ;
collectCastWarning(cg, currentOutput.getType(), toType) ;
OperatorKey newKey = genNewOperatorKey(currentOutput) ;
LOCast cast = new LOCast(innerPlan, newKey, toType) ;
innerPlan.add(cast) ;
try {
innerPlan.connect(currentOutput, cast) ;