Open
Description
π Search Terms
object spread, object rest, object spreading
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about object spreading
β― Playground Link
π» Code
declare const c: { [key: string]: number }
const a: { [key: string]: string } = {
a: '',
...c
}
π Actual behavior
It allows numbers to be in the object, when they shouldn't be allowed.
π Expected behavior
It shouldn't allow numbers.
Additional information about the issue
Because c
has non-literal keys, in this case string
, which could be any string, it doesn't care what's in it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment