-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 3.6.3
Code
class A {
static get callbacks(): any[] {
delete this.callbacks;
return this.callbacks = []
}
}Expected behavior:
No error should be shown

Actual behavior:
error TS2704: The operand of a delete operator cannot be a read-only property.
Playground Link: playground
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug