After years of experience with JavaScript, I recently decided to delve into TypeScript.
Example 1
As I was developing, I discovered that
const A : B = class B {}
This code snippet would result in a warning "Cannot find name 'B'".
However, the following will not.
class B {}
const A : B = B ;
Example 2
Another example is
class B {}
const A : B = B ;
const C : A = A ;
This will trigger a warning "Cannot find name 'A'"
It seems that tsc checking only recognizes anything starting with "class".
In JavaScript, there doesn't appear to be any issues. Compiling them all even works....
So my concern is, it might just be that the tsc checking isn't thorough enough..., however, if I circumvent this, I'll lose the purpose of type checking, so I may have to adjust my writing style.
Can you offer advice on whether I'm mistaken? Or is there another reason for the error?