Reported on https://github.com/elixir-lang/elixir/issues/8800


sexta-feira, 15 de Fevereiro de 2019 às 16:33:18 UTC, Mário Guimarães 
escreveu:
>
> Ok, I will write a report 
>
> sexta-feira, 15 de Fevereiro de 2019 às 15:48:31 UTC, José Valim escreveu:
>>
>> Please do a bug report. We should either raise or just trust the value 
>> returned by __struct__/0 since we don't validate it anywhere else.
>>
>>
>> *José Valim*
>> www.plataformatec.com.br
>> Skype: jv.ptec
>> Founder and Director of R&D
>>
>>
>> On Fri, Feb 15, 2019 at 2:47 PM Mário Guimarães <mario.luis...@gmail.com> 
>> wrote:
>>
>>> Hello,
>>>
>>> given the files `xx.ex` and `yy.ex` defined as
>>>
>>> defmodule XX do
>>>   defstruct [:field]
>>> end
>>>
>>> defmodule YY do
>>>   defdelegate __struct__, to: XX
>>>   defdelegate __struct__(x), to: XX
>>> end
>>>
>>> why does 
>>>
>>> iex(1)> %XX{} == XX.__struct__()
>>> true
>>>
>>> and 
>>>
>>> iex(2)> %YY{} == YY.__struct__()
>>> false
>>>
>>> ?
>>>
>>> It seems that %Mod{} is not equivalent to Mod.__struct__().
>>>
>>> What does %Mod{} really do?
>>>
>>> Thanks
>>> Mário
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "elixir-lang-core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to elixir-lang-co...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/elixir-lang-core/0a942906-d08a-48fc-84a9-e80d19b048f4%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/elixir-lang-core/0a942906-d08a-48fc-84a9-e80d19b048f4%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/314874fb-fa02-4236-b43c-990eef83ec03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to