mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Further optional delete corrections (#44862)
* Add more tests. * Accepted baselines. * Switch to testing the symbol's flags. * Accepted baselines.
This commit is contained in:
committed by
GitHub
parent
e3d6189e3a
commit
248b2c3fc1
@@ -31411,7 +31411,7 @@ namespace ts {
|
||||
const type = getTypeOfSymbol(symbol);
|
||||
if (strictNullChecks &&
|
||||
!(type.flags & (TypeFlags.AnyOrUnknown | TypeFlags.Never)) &&
|
||||
!(exactOptionalPropertyTypes ? hasQuestionToken(symbol.valueDeclaration!) : getFalsyFlags(type) & TypeFlags.Undefined)) {
|
||||
!(exactOptionalPropertyTypes ? symbol.flags & SymbolFlags.Optional : getFalsyFlags(type) & TypeFlags.Undefined)) {
|
||||
error(expr, Diagnostics.The_operand_of_a_delete_operator_must_be_optional);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user