-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 3.6.2
Search Terms:
noImplicitAny generic
Code
class Test<T> {
options: Map<T, string> = new Map()
constructor(options: Map<T, string>) {
}
}
let t = new Test(new Map())
t.options.set("a", "abc")
t.options.set(123, "abc")
Expected behavior:
When using strict / noImplicityAny I would expect that T which implicitly became any would be reported as an error.
Actual behavior:
No error thrown, T becomes of type any.
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug