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.
This commit is contained in:
		
							parent
							
								
									0eb200e569
								
							
						
					
					
						commit
						39d1da7b51
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -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; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue