defmodule Dialyzer.RemoteCall do
  _ = Application.load(:dialyzer)
  case Application.spec(:dialyzer, :vsn) do
    ~c(3.) ++ _ ->
      @dialyzer {:no_return, [map_var: 0]}
      @dialyzer {:no_match, [map_var: 0, mod_var: 0, mod_var: 1]}
    ~c(2.) ++ _ ->
      @dialyzer {:no_fail_call, [map_var: 0]}
    _ ->
      :ok
  end

  def map_var() do
    map = %{a: 1}
    map.key
  end

  def map_var(map) when is_map(map) do
    map.key
  end

  def mod_var() do
    module = Hello
    module.fun
  end

  def mod_var(module) when is_atom(module) or is_atom(elem(module, 0)) do
    module.fun
  end
end

defmodule Dialyzer.RemoteCall do
  _ = Application.load(:dialyzer)
  case Application.spec(:dialyzer, :vsn) do
    ~c(2.) ++ _ ->
      @dialyzer {:no_fail_call, [map_var: 0]}
    three when three < ~c(3.0.2) ->
      # regression introduced in 3.0 for map warnings fixed in 3.0.2
      @dialyzer {:no_match, [map_var: 0, mod_var: 0, mod_var: 1]}
    _ ->
      :ok
  end

  def map_var() do
    map = %{key: 1}
    map.key
  end

  def map_var(map) when is_map(map) do
    map.key
  end

  def mod_var() do
    module = Hello
    module.fun
  end

  def mod_var(module) when is_atom(module) or is_atom(elem(module, 0)) do
    module.fun
  end
end

Update dialyzer tests for OTP-19.1/dialyzer-3.0.2
Update dialyzer tests for OTP-19.1/dialyzer-3.0.2

gfvcastro/elixir,antipax/elixir,lexmag/elixir,elixir-lang/elixir,pedrosnk/elixir,kelvinst/elixir,gfvcastro/elixir,kimshrier/elixir,kimshrier/elixir,antipax/elixir,joshprice/elixir,ggcampinho/elixir,lexmag/elixir,ggcampinho/elixir,beedub/elixir,beedub/elixir,pedrosnk/elixir,kelvinst/elixir,michalmuskala/elixir