code: public void finalizeScope() {
              for (List<Scope> scopes = this.subScopes; scopes.nonEmpty(); scopes = scopes.tail) {
                  Scope impScope = scopes.head;
  
                  if (impScope instanceof FilterImportScope && impScope.owner.kind == Kind.TYP) {
                      WriteableScope finalized = WriteableScope.create(impScope.owner);
  
                      for (Symbol sym : impScope.getSymbols()) {
                          finalized.enter(sym);
                      }
  
                      finalized.listeners.add(new ScopeListener() {
                          @Override
                          public void symbolAdded(Symbol sym, Scope s) {
                              Assert.error("The scope is sealed.");
                          }
  
                          @Override
                          public void symbolRemoved(Symbol sym, Scope s) {
                              Assert.error("The scope is sealed.");
                          }
                      });
  
                      scopes.head = finalized;
                  }
              }
          }
docs: Finalize the content of the ImportScope to speed-up future lookups.
  No further changes to class hierarchy or class content will be reflected.