Changeset 14559


Ignore:
Timestamp:
06/23/13 14:20:40 (10 years ago)
Author:
Mark Evenson
Message:

Backport r14557 | ehuelsmann | 2013-06-22 21:32:46 +0200 (Sat, 22 Jun 2013) | 1 line.

More refactoring of shadowingImport: unbreak METATILITIES.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2.x/src/org/armedbear/lisp/Package.java

    r14550 r14559  
    607607        if (sym == null)
    608608            sym = internalSymbols.get(symbol.name.toString());
    609         if (sym != null) {
    610             if (sym != symbol) {
    611                 if (shadowingSymbols != null)
    612                     shadowingSymbols.remove(symbolName);
    613                 unintern(sym);
    614             } else {
    615                 // Assert argument is already correctly a shadowing import
    616                 Debug.assertTrue(shadowingSymbols != null);
    617                 Debug.assertTrue(shadowingSymbols.get(symbolName) != null);
    618                 return;
    619             }
    620         }
    621         internalSymbols.put(symbol.name.toString(), symbol);
     609
     610        // if a different symbol with the same name is accessible,
     611        // [..] which implies that it must be uninterned if it was present
     612        if (sym != null && sym != symbol) {
     613            if (shadowingSymbols != null)
     614                shadowingSymbols.remove(symbolName);
     615            unintern(sym);
     616        }
     617
     618        if (sym == null || sym != symbol) {
     619            // there was no symbol, or we just unintered it another one
     620            // intern the new one
     621            internalSymbols.put(symbol.name.toString(), symbol);
     622        }
     623
    622624        if (shadowingSymbols == null)
    623625            shadowingSymbols = new HashMap<String,Symbol>();
    624         Debug.assertTrue(shadowingSymbols.get(symbolName) == null);
    625626        shadowingSymbols.put(symbolName, symbol);
    626627    }
Note: See TracChangeset for help on using the changeset viewer.