meh / amnesia

Mnesia wrapper for Elixir.
693 stars 68 forks source link

Another issue with Elixir 1.7 - Kernel.Typespec.defines_type?/3 is undefined #83

Closed dmilith closed 6 years ago

dmilith commented 6 years ago
== Compilation error in file lib/data/model.ex ==
** (UndefinedFunctionError) function Kernel.Typespec.defines_type?/3 is undefined or private. Did you mean one of:

      * defines_type?/2

    (elixir) Kernel.Typespec.defines_type?(Model.RecordedScenario, :t, 0)
    lib/data/model.ex:17: (module)
    lib/data/model.ex:17: (module)

Happens in two of my projects after upgrading backend Elixir to 1.7.3.

My model.ex: https://github.com/VerKnowSys/Yst/blob/master/lib/data/model.ex

dmilith commented 6 years ago

After few clicks of investigation I've notices it's caused by this block of code: https://github.com/meh/amnesia/blob/master/lib/amnesia/table/definition.ex#L938-L940

Making a tuple there works:

unless Kernel.Typespec.defines_type?(__MODULE__, {:t, 0}) do
          @opaque t :: %__MODULE__{}
        end

as commited in https://github.com/meh/amnesia/commit/3dc0cdcbf8af263d1d784758037ce50291fccc37

It's not present in "master" tho?

dmilith commented 6 years ago

Ok, did remove mix.lock, added this to mix.exs:

{:amnesia, github: "meh/amnesia", branch: "master", override: true},
{:exquisite, github: "meh/exquisite", branch: "master", override: true},

And problem solved! ;)