-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Environment
$ elixir --version
Erlang/OTP 21 [erts-10.2.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
Elixir 1.8.1 (compiled with Erlang/OTP 21)
Current behavior
Given a file defining this module
defmodule MyOtherModule do
def foo, do: "hello"
IO.inspect Module.definitions_in(__MODULE__, :def), label: "Definitions 1"
defoverridable [foo: 0]
IO.inspect Module.definitions_in(__MODULE__, :def), label: "Definitions 2"
end
when compiled gives the following output:
$ mix do clean, compile
Compiling 18 files (.ex)
Definitions 1: [foo: 0]
Definitions 2: []
Generated things app
That is, the module definitions have been lost after the defoverridable
clause.
Expected behavior
Declaring something as overridable should not affect the fact that it is a declared definition, consequently the output should be
$ mix do clean, compile
Compiling 18 files (.ex)
Definitions 1: [foo: 0]
Definitions 2: [foo: 0]
Generated things app
Metadata
Metadata
Assignees
Labels
No labels