I had an impression that TypeScript allowed you to take a valid JavaScript program and "enforce" types by making a few key symbols type-safe. This would propagate the types through all the usages, and make you update all the symbol references.
This seems to be incorrect. In the following example the makeDiv function is calling a typed make function without checking the parameter type.
// strongly typed arguments
function make(tagName: string, className: string) {
alert ("Make: " + className.length);
}
// no typing
function makeDiv(className) {
// calling the typed function without type checking
return make("div", className);
}
makeDiv("test");
makeDiv(6); // bang!
Do I miss something here? Is there is a way to enforce "stricter" type checking? Or is this a design decision made by TypeScript creators?