From 39d1da7b51e6984a332a7eb68ae4048242b1adb8 Mon Sep 17 00:00:00 2001 From: Fabian Schmitthenner Date: Sat, 28 Nov 2015 01:24:10 +0000 Subject: Better error message Also show types when nix cannot compare values of different types. This is also more consistent since types are already shown when comparing values of the same not comparable type. --- src/libexpr/primops.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index cf2d3d278f28..5a1f47b55e0d 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -248,7 +248,7 @@ struct CompareValues bool operator () (const Value * v1, const Value * v2) const { if (v1->type != v2->type) - throw EvalError("cannot compare values of different types"); + throw EvalError(format("cannot compare %1% with %2%") % showType(*v1) % showType(*v2)); switch (v1->type) { case tInt: return v1->integer < v2->integer; -- cgit 1.4.1