Wondering why we need the last expression in this code from xref_reader.erl

Hello,
I’m doing some stuff with xref and I stumbled upon this piece of code at xred_reader.erl:71:

    #xrefr{module = M, def_at = DefAt,
	   l_call_at = LCallAt, x_call_at = XCallAt,
	   el = LC, ex = XC, x = X, df = Depr, on_load = OnLoad,
	   lattrs = AL, xattrs = AX, battrs = B, unresolved = U} = S,
    OL = case OnLoad of
             undefined -> [];
             F ->
                 [{M, F, 0}]
         end,
    #xrefr{def_at = DefAt,
	   l_call_at = LCallAt, x_call_at = XCallAt,
	   el = LC, ex = XC, x = X, df = Depr, on_load = OnLoad,
	   lattrs = AL, xattrs = AX, battrs = B, unresolved = U} = S,
   ...

Why do we need last expression?

1 Like

It looks like an accidental artifact of merge conflict resolution. I created [xref] drop unused code by max-au · Pull Request #7035 · erlang/otp · GitHub to fix this, thanks for reporting!

3 Likes