compiler/resolution/lifetime.cpp
// A variables with a type with `infinite borrow lifetime` should have
// infinite intrinsic borrow lifetime.
A variables with a type with `infinite borrow lifetime` should have
infinite intrinsic borrow lifetime.
A variables with a type with ` infinite borrow lifetime ` should have infinite intrinsic borrow lifetime .
static bool typeHasInfiniteBorrowLifetime(Type* type) {
  if (type == dtNil)
    return true;
  if (type->symbol->hasFlag(FLAG_DATA_CLASS))
    return true;
  if (type->symbol->hasFlag(FLAG_C_PTR_CLASS) ||
      type->symbol->hasFlag(FLAG_EXTERN) ||
      type == dtCVoidPtr ||
      type == dtCFnPtr)
    return true;
  if (isSubClass(type, dtLocale))
    return true;
  if (isUnmanagedClassType(type)) {
    return true;
  }
  return false;
}
static bool typeHasInfiniteBorrowLifetime ( Type * type ) { if ( type == dtNil ) return true ; if ( type -> symbol -> hasFlag ( FLAG_DATA_CLASS ) ) return true ; if ( type -> symbol -> hasFlag ( FLAG_C_PTR_CLASS ) || type -> symbol -> hasFlag ( FLAG_EXTERN ) || type == dtCVoidPtr || type == dtCFnPtr ) return true ; if ( isSubClass ( type , dtLocale ) ) return true ; if ( isUnmanagedClassType ( type ) ) { return true ; } return false ; }
A variables with a type with `infinite borrow lifetime` should have
infinite intrinsic borrow lifetime.
A variables with a type with ` infinite borrow lifetime ` should have infinite intrinsic borrow lifetime .
// If it has type nil, it has infinite lifetime // low-level ddata type not subject to analysis // Types for C compatibility are assumed to have infinite lifetime. // Locale type has infinite lifetime // (since locales exist for the entire program run) // unmanaged class instances have infinite lifetime