mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Merge pull request #30094 from Kingwl/improve_completions_for_optional_props
check completions with assignable rather than identity
This commit is contained in:
@@ -7406,7 +7406,7 @@ namespace ts {
|
||||
const nameType = property.name && getLiteralTypeFromPropertyName(property.name);
|
||||
const name = nameType && isTypeUsableAsPropertyName(nameType) ? getPropertyNameFromType(nameType) : undefined;
|
||||
const expected = name === undefined ? undefined : getTypeOfPropertyOfType(contextualType, name);
|
||||
return !!expected && isLiteralType(expected) && !isTypeIdenticalTo(getTypeOfNode(property), expected);
|
||||
return !!expected && isLiteralType(expected) && !isTypeAssignableTo(getTypeOfNode(property), expected);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user