Skip to content

bug in redefining modules in nested modules #1057

Closed
@yrashk

Description

@yrashk
iex(1)> defmodule A do
...(1)>   defrecord State, a: nil
...(1)> 
...(1)>   defmodule B do
...(1)>     defrecord State, b: nil
...(1)> 
...(1)>     def a(State[b: b]), do: b
...(1)>   end
...(1)> end
iex:5: redefining module A.State
{:module,A,<<70,79,82,49,0,0,6,76,66,69,65,77,65,116,111,109,0,0,0,96,0,0,0,10,8,69,108,105,120,105,114,45,65,8,95,95,105,110,102,111,95,95,9,109,111,100,117,108,101,100,...>>,{:module,A.B,<<70,79,82,49,0,0,7,48,66,69,65,77,65,116,111,109,0,0,0,115,0,0,0,12,10,69,108,105,120,105,114,45,65,45,66,8,95,95,105,110,102,111,95,95,4,100,111,99,115,9,...>>,{:a,1}}}
iex(2)> 
nil
iex(3)> A.State.new
A.State[b: nil]
iex(4)> A.B.State.new
** (UndefinedFunctionError) undefined function: A.B.State.new/0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions