*  @param sym           The symbol.
     *  @param s             The scope.
     */
    private void enterSynthetic(DiagnosticPosition pos, Symbol sym, Scope s) {
        if (sym.name != names.error && sym.name != names.empty) {
            for (Scope.Entry e = s.lookup(sym.name); e.scope == s; e = e.next()) {
                if (sym != e.sym && sym.kind == e.sym.kind) {
                    // VM allows methods and variables with differing types
                    if ((sym.kind & (MTH|VAR)) != 0 &&
                        !types.erasure(sym.type).equals(types.erasure(e.sym.type)))
                        continue;
                    duplicateError(pos, e.sym);
                    break;
                }
            }
        }
        s.enter(sym);
    }