ericmj/ex2ms

Vars has been removed from the Env struct in elixir 1.13.0-dev (current master)

juanperi opened this issue · 1 comments

In the following commit, vars has been removed: elixir-lang/elixir@106a99f

This is only relevant for the upcoming 1.13 release.
I was trying to test my project against master to check compatibility and possible regressions, when I hit the following error:

== Compilation error in file lib/ex_rated.ex ==
** (KeyError) key :vars not found in: #Macro.Env<aliases: [], context: nil, context_modules: [], file: "/Users/jperi/workspace/sylar/deps/ex_rated/lib/ex_rated.ex", function: {:delete_bucket, 2}, functions: [{Kernel, [!=: 2, !==: 2, *: 2, +: 1, +: 2, ++: 2, -: 1, -: 2, --: 2, /: 2, <: 2, <=: 2, ==: 2, ===: 2, =~: 2, >: 2, >=: 2, abs: 1, apply: 2, apply: 3, binary_part: 3, bit_size: 1, byte_size: 1, ceil: 1, div: 2, elem: 2, exit: 1, floor: 1, function_exported?: 3, get_and_update_in: 3, get_in: 2, hd: 1, inspect: 1, inspect: 2, is_atom: 1, is_binary: 1, is_bitstring: 1, is_boolean: 1, is_float: 1, is_function: 1, is_function: 2, ...]}], lexical_tracker: #PID<0.10562.0>, line: 243, macro_aliases: [], macros: [{Ex2ms, [fun: 1]}, {Kernel, [!: 1, &&: 2, ..: 2, ..//: 3, <>: 2, @: 1, alias!: 1, and: 2, binding: 0, binding: 1, def: 1, def: 2, defdelegate: 2, defexception: 1, defguard: 1, defguardp: 1, defimpl: 2, defimpl: 3, defmacro: 1, defmacro: 2, defmacrop: 1, defmacrop: 2, defmodule: 2, defoverridable: 1, defp: 1, defp: 2, defprotocol: 2, defstruct: 1, destructure: 2, get_and_update_in: 2, if: 2, in: 2, is_exception: 1, is_exception: 2, is_nil: 1, is_struct: 1, ...]}], module: ExRated, requires: [Application, Ex2ms, GenServer, Kernel, Kernel.Typespec], ...>
    (ex2ms 1.6.0) lib/ex2ms.ex:213: Ex2ms.translate_param/2
    (ex2ms 1.6.0) lib/ex2ms.ex:184: Ex2ms.translate_head/2
    (ex2ms 1.6.0) lib/ex2ms.ex:116: Ex2ms.translate_clause/2
    (elixir 1.13.0-dev) lib/enum.ex:1583: Enum."-map/2-lists^map/1-0-"/2
    (ex2ms 1.6.0) expanding macro: Ex2ms.fun/1
    lib/ex_rated.ex:243: ExRated.delete_bucket/2
could not compile dependency :ex_rated, "mix compile" failed. You can recompile this dependency with "mix deps.compile ex_rated", update it with "mix deps.update ex_rated" or clean it with "mix deps.clean ex_rated"

Thanks for noticing this issue. We should use https://hexdocs.pm/elixir/Macro.Env.html#vars/1 instead.

This issue is up for grabs if anyone wants to submit a PR! 💜