title: mypy v0.812 incompatible type "str"; expected "Union[Literal['a'], Union[Literal['b']..]
body: <p>Is there a way to make mypy happy with this code without changing <code>class Config</code>, at the moment I cannot change that class (using typer for a cli app). I am aware I can use <code># type: ignore </code> but is there any other solution?</p>
  <pre class="lang-py prettyprint-override"><code>&quot;&quot;&quot;
  mypy --version
  mypy 0.812
  &quot;&quot;&quot;
  from enum import Enum
  from pathlib import Path
  
  from typing_extensions import Literal
  
  
  class Config(str, Enum):
    Debug = 'Debug'
    Release = 'Release'
  
  
  BuildMode = Literal[&quot;ASAN&quot;, &quot;UBSAN&quot;, &quot;Coverage&quot;, &quot;Release&quot;, &quot;Debug&quot;]
  
  
  def run_c_tests(results_dir: Path, mode: BuildMode):
    ...
  
  
  configuration = Config.Debug
  
  # mypy error: Argument 2 to &quot;run_c_tests&quot; has incompatible type &quot;str&quot;; expected &quot;Union[Literal['ASAN'], Literal['UBSAN'], Literal['Coverage'], Literal['Release'], Literal['Debug']]&quot;
  run_c_tests(Path('apath'), configuration.value)
  
  </code></pre>
  <p>Mypy v0.782 does not complain on the code above but 0.812 does.</p>