You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Erlang/OTP 17, Interactive Elixir (0.14.3-dev)
Consider this code, with an error: colour in the structure is misspelled as color in inspect/2
defmodule Shirt do
defstruct size: "M", colour: "green"
end
defimpl Inspect, for: Shirt do
import Inspect.Algebra
def inspect(item, _options) do
msg = concat([item.size, break, item.color])
pretty(msg, 80)
end
end
Now do this:
iex(1)> c "shirt.ex"
[Inspect.Shirt, Shirt]
iex(2)> %Shirt{}
Crash dump was written to: erl_crash.dump
eheap_alloc: Cannot allocate 1098556536 bytes of memory (of type "heap").
If you put an IO.puts("testing") into the inspect/2 function, you will see that this is an infinite loop.
The text was updated successfully, but these errors were encountered:
Using Erlang/OTP 17, Interactive Elixir (0.14.3-dev)
Consider this code, with an error:
colour
in the structure is misspelled ascolor
ininspect/2
Now do this:
If you put an
IO.puts("testing")
into theinspect/2
function, you will see that this is an infinite loop.The text was updated successfully, but these errors were encountered: