A compiler which checks types for 3 scenarios:
- Issue with un-compatible types on declaration and expression
fn("craig-string"); // throw with string vs number
function fn(a: number) {}
- Issue with unknown type on declaration and expression
fn("craig-string"); // throw with string vs ?
function fn(a: made_up_type) {} // throw with bad type
- Issue with property name
interface Person {
name: string;
}
fn({ nam: "craig" }); // throw with "nam" vs "name"
function fn(a: Person) {}