Closed
Description
Consider the interface:
interface xyz {
num: 1
str: "ok"
}
Currently the following snippet generates a type error:
let foo: xyz = {}
My proposal is the whenever a variable is declared to contain only one possible value, that value should be assumed whenever the variable's value is not specified. So, the above snippet would then not generate an error, but this would:
let foo: xyz = { num: 2 }
This proposed feature will make it easier to write clearer and simpler TypeScript code.