mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 19:27:35 -06:00
Missing properties in fresh object literals are known to be undefined
This commit is contained in:
parent
228a885e49
commit
b17e75b52b
@ -9604,6 +9604,15 @@ namespace ts {
|
||||
}
|
||||
return Ternary.False;
|
||||
}
|
||||
if (relation === subtypeRelation && target.flags & TypeFlags.FreshLiteral) {
|
||||
const excessProperty = getUnmatchedProperty(target, source, /*requireOptionalProperties*/ true);
|
||||
if (excessProperty) {
|
||||
if (reportErrors) {
|
||||
reportError(Diagnostics.Property_0_does_not_exist_on_type_1, symbolToString(excessProperty), typeToString(target));
|
||||
}
|
||||
return Ternary.False;
|
||||
}
|
||||
}
|
||||
let result = Ternary.True;
|
||||
const properties = getPropertiesOfObjectType(target);
|
||||
for (const targetProp of properties) {
|
||||
|
||||
@ -1273,7 +1273,7 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
function getDefaultValueForOption(option: CommandLineOption) {
|
||||
function getDefaultValueForOption(option: CommandLineOption): {} {
|
||||
switch (option.type) {
|
||||
case "number":
|
||||
return 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user