public void complete(Symbol sym) throws CompletionFailure {
        if (sym.kind == TYP) {
            ClassSymbol c = (ClassSymbol)sym;
            c.members_field = new Scope.ErrorScope(c); // make sure it's always defined
            boolean saveSuppressFlush = suppressFlush;
            suppressFlush = true;
            try {
                completeOwners(c.owner);
                completeEnclosing(c);
            } finally {
                suppressFlush = saveSuppressFlush;
            }
            fillIn(c);
        } else if (sym.kind == PCK) {
            PackageSymbol p = (PackageSymbol)sym;
            try {
                fillIn(p);
            } catch (IOException ex) {
                throw new CompletionFailure(sym, ex.getLocalizedMessage()).initCause(ex);
            }
        }
        if (!filling && !suppressFlush)
            annotate.flush(); // finish attaching annotations
    }