c34e6d71bc
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. |
||
---|---|---|
.. | ||
attr-path.cc | ||
attr-path.hh | ||
common-opts.cc | ||
common-opts.hh | ||
eval.cc | ||
eval.hh | ||
expr-to-xml.cc | ||
expr-to-xml.hh | ||
get-drvs.cc | ||
get-drvs.hh | ||
lexer.l | ||
Makefile.am | ||
names.cc | ||
names.hh | ||
nix.sdf | ||
nixexpr-ast.def | ||
nixexpr.cc | ||
nixexpr.hh | ||
parser.hh | ||
parser.y | ||
primops.cc |