private void addScope(@NotNull CompileScope scope) {
    if (scope instanceof CompositeScope compositeScope) {
      for (CompileScope childScope : compositeScope.myScopes) {
        addScope(childScope);
      }
    }
    else {
      myScopes.add(scope);
    }
  }
private void addScope(@NotNull CompileScope scope)