title: TypeScript type guards and "only refers to a type, but is being used as a value here."
body: <p>I'm using Typescript 3.2.2 and unable to achieve the most basic implementation of type guards:</p>
  
  <pre><code>interface Bird {
      fly(): boolean;
  }
  
  interface Fish {
      swim(): boolean;
  }
  
  function swimIfYouCan(x: Fish | Bird) {
      if ((&lt;Fish&gt;x).swim) {
          return true
      }
  }
  </code></pre>
  
  <p>This produces <code>Error:(50, 11) TS2693: 'Fish' only refers to a type, but is being used as a value here.</code> in WebStorm and <code>SyntaxError: /Users/sea-kent/git/docket-management/webapp/src/App.tsx: Unexpected token (51:8)</code> from <code>yarn</code>. Is there a configuration needed to enable this syntax?</p>