title: Why does a switch statement on an enum throw 'not comparable to type' error?
body: <p>While doing a Lynda tutorial on Typescript ( <a href="https://www.lynda.com/Visual-Studio-tutorials/TypeScript-types-part-2/543000/565613-4.html#tab" rel="noreferrer">https://www.lynda.com/Visual-Studio-tutorials/TypeScript-types-part-2/543000/565613-4.html#tab</a> ), I hit a snag. The sample code illustrates how switch statements work in TypeScript but the code that seems to work fine for the instructor throws a <em>Type 'x' is not comparable to type 'y'</em> error. Here's the code:</p>
  
  <pre><code>enum temperature{
      cold,
      hot
  }
  
  let temp = temperature.cold;
  
  switch (temp) {
      case temperature.cold:
          console.log("Brrr....");
          break;
      case temperature.hot:
          console.log("Yikes...")
          break;
  }
  </code></pre>
  
  <p>I get an error and squiggles under <code>case temperature.hot:</code> saying:</p>
  
  <pre class="lang-none prettyprint-override"><code>Type 'temperature.hot' is not comparable to type 'temperature.cold'
  </code></pre>
  
  <p>What gives?</p>