presto-main/src/main/java/io/prestosql/sql/planner/sanity/TypeValidator.java/TypeValidator/checkCall
class TypeValidator:        private void checkCall(Symbol symbol, Signature signature, List<Expression> arguments)
        {
            Type expectedType = types.get(symbol);
            Type actualType = metadata.getType(signature.getReturnType());
            verifyTypeSignature(symbol, expectedType.getTypeSignature(), actualType.getTypeSignature());

            checkArgument(signature.getArgumentTypes().size() == arguments.size(),
                    "expected %s arguments, but found %s arguments",
                    signature.getArgumentTypes().size(),
                    arguments.size());

            for (int i = 0; i < arguments.size(); i++) {
                TypeSignature expectedTypeSignature = signature.getArgumentTypes().get(i);
                if (expectedTypeSignature.getBase().equals(FunctionType.NAME)) {
                    continue;
                }
                TypeSignature actualTypeSignature = typeAnalyzer.getType(session, types, arguments.get(i)).getTypeSignature();
                verifyTypeSignature(symbol, expectedTypeSignature, actualTypeSignature);
            }
        }