murex icon indicating copy to clipboard operation
murex copied to clipboard

nil pointer error in `alter --merge`

Open lmorg opened this issue 6 months ago • 0 comments

Describe the bug: Nil pointer error merging an object with an array of maps

murex » %{} ~> %{bob: [{message: "hello $k"}]  }
Error in `expr` (0,1): cannot merge map[bob:[map[message:hello c]]] with map[]: cannot merge new map into old. Likely this is because of a data-type mismatch: runtime error: invalid memory address or nil pointer dereference
                     > Expression: %{} ~> %{bob: [{message: "hello $k"}]  }
                     >           :  ^
                     > Character : 2
                     > Symbol    : ObjectBegin
                     > Value     : ''

also happens with

murex » %[a..c] -> foreach k { json <~ %{$k: [{message: "hello $k"}]  } }
Error in `expr` (0,14): cannot perform merge 'map[b:[map[message:hello b]]]' into 'json': cannot merge new map into old. Likely this is because of a data-type mismatch: runtime error: invalid memory address or nil pointer dereference
                      > Expression: json <~ %{$k: [{message: "hello $k"}]  }
                      >           : ^
                      > Character : 1
                      > Symbol    : Bareword
                      > Value     : 'json'
Error in `expr` (0,14): cannot perform merge 'map[c:[map[message:hello c]]]' into 'json': cannot merge new map into old. Likely this is because of a data-type mismatch: runtime error: invalid memory address or nil pointer dereference
                      > Expression: json <~ %{$k: [{message: "hello $k"}]  }
                      >           : ^
                      > Character : 1
                      > Symbol    : Bareword
                      > Value     : 'json'

Expected behaviour: Objects merge

Platform (please complete the following information):

  • OS, output from uname -a if supported: macOS & Linux
  • Terminal Emulator: n/a
  • Murex version, output from version --no-app-name: latest

Additional context Breaks systemctl autocompletion in v6.3.x

lmorg avatar Aug 01 '24 09:08 lmorg