title: flow string is incompatible with string literal?
body: <p>I'm trying to annotate a custom event emitter and restrict the event names to specific strings.  For this example though I'll just use one event name:</p>
  
  <pre><code>class MyEmitter extends EventEmitter {
    on(event: 'foo', listener: Function): this {
      return super.on(event, listener);
    }
  }
  </code></pre>
  
  <p>Flow doesn't like this though and complains that <code>'foo'</code> is not compatible with <code>string</code>??</p>
  
  <pre><code> 24: class MyEmitter extends EventEmitter {
             ^^^^^^^^^^^^ MyEmitter. Cannot extend
   24: class MyEmitter extends EventEmitter {
                               ^^^^^^^^^^^^ EventEmitter
    Property `on` is incompatible:
             v-------------------------------------------
       25:   on(event: 'foo', listener: Function): this {
       26:     return super.on(event, listener);
       27:   }
             ^ function. This type is incompatible with
      660:   on(event: string, listener: Function): this;
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function type. See lib: /private/tmp/flow/flowlib_15c48d81/node.js:660
        The first parameter is incompatible:
           25:   on(event: 'foo', listener: Function): this {
                           ^^^^^ string literal `foo`. Expected string literal `foo`
          660:   on(event: string, listener: Function): this;
                           ^^^^^^ string. See lib: /private/tmp/flow/flowlib_15c48d81/node.js:660
  </code></pre>
  
  <p>[edit]</p>
  
  <p>standalone example on <a href="https://flow.org/try/#0MYGwhgzhAEBiD29oG8BQ1rwHYAoBmiAXNBAC4BOAllgOYCUK60Avqq6qJDAEJjnQBTAB6kBWACYwESNBmz4i0AOQAjPkoayWbIA" rel="nofollow noreferrer">tryflow</a>:</p>
  
  <pre><code>class Foo {
    on(foo: string) {
    }
  }
  
  class Bar extends Foo {
    on(foo: 'bar') {
    }
  }
  </code></pre>