lmorg / murex

A smarter shell and scripting environment with advanced features designed for usability, safety and productivity (eg smarter DevOps tooling)
https://murex.rocks
GNU General Public License v2.0
1.44k stars 27 forks source link

Comparing two arrays or two maps with `==` causes a panic #831

Closed tiymat closed 1 month ago

tiymat commented 1 month ago

Describe the bug: Executing an expression with using == to compare two arrays or two maps causes a panic (comparing one map and one array does not panic.)

%{"foo": "bar"} == %[1] # false
%{"foo": "bar"} == %{"bar": "baz"} # panic
%[1] == %[1] # panic

Expected behaviour: An error should be printed without panicking. (Unless == is a reasonable thing to do with two arrays or maps? I couldn't find documentation for == under the Operators and Tokens section on the site.)

Screenshots: N/A

Platform (please complete the following information):

Additional context N/A

lmorg commented 1 month ago

That is a weird one. Works when the array is either side, but not when it is both sides.

lmorg commented 1 month ago

Found the issue. Pushed the fix (plus additional tests) to develop