diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-05-11T15·50+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2009-05-11T15·50+0000 |
commit | c34e6d71bc62bb83f3bfed69f781ded4d5a46d3a (patch) | |
tree | 48d5876d3cf5ae6c07dc036774a051c4409865f5 /src/libstore/gc.cc | |
parent | 9536ba19d437a82d4b521709b49ef6977321b692 (diff) |
* Disallow equality tests between attribute sets. This was always
broken, but now the evaluator checks for it to prevent Nix expressions from relying on undefined behaviour. Equality tests are implemented using a shallow pointer equality test between ATerms. However, because attribute sets are lazy and contain position information, this can give false positives. For instance, previously let y = {x = 1;}; in y == y evaluated to true, while the equivalent expression {x = 1;} == {x = 1;} evaluated to false. So disallow these tests for now. (Eventually we may want to implement deep equality tests for attribute sets, like lib.eqStrict.) * Idem: disallow comparisons between functions. * Implemented deep comparisons of lists. This had the same problem as attribute sets - the elements in the list weren't evaluated. For instance, ["xy"] == [("x" + "y")] evaluated to false. Now it works properly.
Diffstat (limited to 'src/libstore/gc.cc')
0 files changed, 0 insertions, 0 deletions