在以下情况下,我想在vscode和编译时出错:
场景1:
let myAny: any;
let myString: string;
myString = myAny; // error
myString = <string> myAny; // ok
myAny = myString; // error
myAny = <any> myString; // ok
场景2:
let myAny: any;
let myString: string;
foo(myParam: string): void{}
foo(myAny); // error
foo(myString); // ok
foo(<string> myString); // ok