Re: Record field matching problem under debugger
Dan Gudmundsson <[email protected]> Sun, 2 Jan 2022 22:17:23 +0100
| Newsgroups | gmane.comp.lang.erlang.general |
|---|---|
| Message-ID | <CANX4uuO07bByiHEDF88-khJfGcOGKH0ZCCgJGdjfqa+vZY2DWQ@mail.gmail.com> |
Hmm, I "improved" the record handling recently in the debugger, can you make a github issue on this so I don't forget about it. /Dan On Sun, Jan 2, 2022 at 10:00 PM Wojtek Surowka <[email protected]> wrote: > I have noticed that some functionality does not work for me if I run my > Erlang system under debugger. After investigation I constructed a > minimal example to see the problem. Is it expected or is it a bug? I > use Erlang/OTP 24. > > The problem can be seen with the following module: > > -module(testrec). > -export([test/0]). > > -record(test, {field1, field2}). > > func1(Field) when Field =:= #test.field1 -> ok. > func2(#test.field1) -> ok. > > test() -> > io:format("1: ~p~n", [func1(#test.field1)]), > io:format("2: ~p~n", [func2(#test.field1)]). > > If I compile this and run test(), I am getting two ok's printed as > expected. But if I start debugger first with debugger:start() and > select the module for debugging with ii(testrec) the function func2 > does not work: > > 6> testrec:test(). > 1: ok > ** exception error: no function clause matching testrec:func2(2) > (testrec.erl, line 7) > in function testrec:test/0 (testrec.erl, line 11) > > Thanks, > Wojtek >