Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 139923

flowtype typeof class does not work as expected

$
0
0

Below code does not typecheck. THe error says:

"Cannot assign new YourClass() to test1 because YourClass [1] is incompatible with class YourClass [2]."

/* @flow */

class YourClass {
  method(){}
}

let test1: typeof YourClass = new YourClass();

What exactly does typeof SomeClass infer to?

Can someone explain what is going on?


Viewing all articles
Browse latest Browse all 139923

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>