Breaking change to extends any
causes confusing behavior with indirect references to any
#38555
Labels
extends any
causes confusing behavior with indirect references to any
#38555
TypeScript Version: 3.9.2
Search Terms: #29571, "extends any"
Code
Expected behavior:
store.user = "test"
should succeed without failure.Actual behavior:
Because
KSMConfig["store"]
is typed asany
, due to the breaking change made in 3.9 to the behavior ofextends any
, the type gets reinterpreted asunknown
and the compiler exclaims:Playground Link: playground
Third-party typings for Javascript libraries often substitute
any
for incomplete types. This breaking change makes it hard to write functions that transform third-party types that reduce toany
.Using type assertions to fixup the type afterward is cumbersome.
Could the change be relaxed to alias
any
tounknown
only whenany
is explicitly requested? i.e.The text was updated successfully, but these errors were encountered: