title: How can I suppress dialyzer warning on comparison between module variable and local static variable?
body: <p>Dialyzer blames the code trying to match against module variable:</p>
  
  <pre><code>defmodule Main do
    # -&gt; :demo
    @env Application.get_env(:myproject, :env)
  
    def run do
      case @env do
        :production -&gt; 1
        _ -&gt; 2
      end
    end
  end
  </code></pre>
  
  <pre><code>lib/myproject/main.ex:6:pattern_match
  The pattern can never match the type.
  
  Pattern:
  :production
  
  Type:
  :demo
  </code></pre>
  
  <p>How can I avoid the warning, or should I write as below every time?</p>
  
  <pre><code>  def run do
      env = Application.get_env(:myproject, :env)
  
      case env do
        ...
      end
    end
  </code></pre>