In the following, when run, javascript has a runtime error. Why doesn't typescript see this as a type error?
const x : ((nv : any) => Map<string,string>) = function (nv : Map<string,string>) { return nv }
let a = "hi there"
let aMap = x(a)
console.log(aMap.get('foo'))