Return statements in cached functions are transformed to utils.ThreadLocalPage.get().addRequestScopedVar("cachedfun1",val);, and the cached value is returned at the end.
This causes an issue when a return statement is followed by other (return) statements, e.g.:

cached function isProxied() : Bool {
  if(remoteAddress().contains(",")){
    log("with comma");
    return true;
  } 
  log("without comma");
  return false;
}

will always return false and always logs “without comma”.

Submitted by Elmer van Chastelet on 9 September 2025 at 21:35

Log in to post comments