I recently started to write typescript but have years experience with JS.
Example 1
Then while development I found that
const A : B = class B {}
Above will throw warning of "Cannot fine name'B'".
However, this will not.
class B {}
const A : B = B ;
Example 2
The other example is
class B {}
const A : B = B ;
const C : A = A ;
This will throw warning of "Cannot fine name'A'"
The result, tsc checking seems like only can recognize anything start from "class".
In JS perspective there is nothing wrong. Even compile with all of them will work....
So my question is, I am thinking this is just the tsc checking not good enough...., however, if I bypass this will lose the meaning of type checking, therefore I can only compromise my writing style probably need to drop it down.
Can you provide me some advise if I am wrong? or if there another reason for the error?