         cond do
           :lists.member(key, acc) ->
             []
-          is_list(warn) ->
-            :elixir_errors.warn warn_info(warn), "undefined module attribute @#{key}, " <>
+          is_list(stack) ->
+            :elixir_errors.warn warn_info(stack), "undefined module attribute @#{key}, " <>
               "please remove access to @#{key} or explicitly set it before access"
             nil
           true ->

        "could not call #{fun} on module #{inspect module} because it was already compiled"
  end

  defp warn_if_redefining_attribute(warn, table, key) when is_list(warn) do
    case :ets.lookup(table, key) do
      [{_, val}] when val != nil ->
        :elixir_errors.warn warn_info(warn), "redefining @#{Atom.to_string(key)} attribute"
      _other -> 
        false
    end
  end
  defp warn_if_redefining_attribute(_caller, _table, _key), do: false
end

  end

  @doc false
  def get_attribute(module, key, stack) when is_atom(key) and (is_list(stack) or is_nil(stack)) do
    assert_not_compiled!(:get_attribute, module)
    table = data_table_for(module)

