code: private boolean canAccessDeprecatedTypes(NodeTraversal t) {
      Node scopeRoot = t.getClosestHoistScopeRoot();
      if (NodeUtil.isFunctionBlock(scopeRoot)) {
        scopeRoot = scopeRoot.getParent();
      }
      Node scopeRootParent = scopeRoot.getParent();
  
      return
      // Case #1
      (deprecationDepth > 0)
          // Case #2
          || (getTypeDeprecationInfo(getTypeOfThis(scopeRoot)) != null)
          // Case #3
          || (scopeRootParent != null
              && scopeRootParent.isAssign()
              && getTypeDeprecationInfo(bestInstanceTypeForMethodOrCtor(scopeRoot)) != null);
    }
docs: Returns whether it's currently OK to access deprecated names and
  properties.
  
  There are 3 exceptions when we're allowed to use a deprecated
  type or property:
  1) When we're in a deprecated function.
  2) When we're in a deprecated class.
  3) When we're in a static method of a deprecated class.