GetFirefly/firefly

Explicitly capturing stacktrace in exception pattern in try catch does not compile

KronicDeth opened this issue · 1 comments

At c60025a in #562, using the full Class:Exception:Stacktrace does not compile

init.erl

-module(init).
-export([start/0]).
-import(erlang, [display/1]).

start() ->
  Module = erlang,
  Function = <<"+">>,
  Args = [0, 1],
  try spawn_monitor(Module, Function, Args) of
    {ChildPid, ChildSpawnMonitor} ->
      display({child, ChildPid, spawned, with, monitor, ChildSpawnMonitor})
  catch
    Class:Exception:Stacktrace -> display({caught, Class, Exception, Stacktrace})
  end,
  display({parent, alive, true}).

Compilation Output

  Compiling tests/lib/erlang/spawn_monitor_3/with_atom_module/without_atom_function_errors_badarg/init.erl
!eir.trace_refAssertion failed: (succeeded(ConcreteT::verifyConstructionInvariants( generateUnknownStorageLocation(ctx), args...))), function get, file /Users/luke.imhoff/.local/share/llvm/lumen/include/mlir/IR/StorageUniquerSupport.h, line 92.

Fixed in 9572fc0