boolean skipForObjectClass)
{
boolean verifyReturnType = env.getBooleanEnvVariable(
Environment.CheckReturnType, true);
if (!StringUtil.nullOrEmptyOrBlankString(expectedType) && verifyReturnType) {
TypeRetriever retriever = env.getTypeRetriever();
TypeInfo convertedTo = retriever.getTypeInfo(expectedType);
if (convertedTo != null) {
TypeInfo convertedFrom = tree.getTypeInfo();
// The return type is expected to be a container type.
if (!StringUtil.nullOrEmptyOrBlankString(containerType)) {
// Get the expected container type
TypeInfo toContainerType = retriever.getTypeInfo(containerType);
if (toContainerType == null) {
errors.add (Fmt.S(
"Cannot find type '%s' when evaluating the return value of the expression.",
toContainerType));
return;