[e-lang] Bug (0.8.35n / 0.8.36t): domain.diverge()

Mark S. Miller markm at cs.jhu.edu
Tue Sep 19 11:38:11 CDT 2006


Kevin Reid wrote:
> ? [1].asMap().diverge().domain().diverge()
> # problem: <ArrayStoreException>
> #
> #   - ESet#diverge()
> #   . [0].asSet().readOnly().diverge()


This is now bug
https://sourceforge.net/tracker/index.php?func=detail&aid=1561585&group_id=75274&atid=551529

I've reproduced it under on the current svn HEAD version of E, where it acts 
the same. Looking at it under the debugger, the problem seems to be that an 
ESet is normally represented internally as an EMap whose keys column contain 
the elements of the set, and whose values column is a vacuous column of Voids. 
However, an ESet representing the domain of an EMap actually holds onto this 
EMap, so that it can continue to provide a readOnly view of the domain of that 
EMap. However, the non-vacuous values column of that EMap breaks a bogus 
assumption coded into ESet#diverge():

     public FlexSet diverge(Class type) {
         return FlexSet.make(myMap.diverge(type, Void.class));
     }

The bogus assumption is that myMap's values column is vacuously a column of 
Voids. When it isn't, the above code breaks. Besides fixing the bug here, I 
need to inspect the rest of ESet and its subclasses for other occurrences of 
this assumption.


-- 
Text by me above is hereby placed in the public domain

     Cheers,
     --MarkM


More information about the e-lang mailing list