Skip to content

fix: skip member expressions in setTimeout arrow functions - #173

Merged
43081j merged 1 commit into
mainfrom
jg/drop-members
Oct 17, 2026
Merged

43081j merged 1 commit into
mainfrom
jg/drop-members

Conversation

@43081j

@43081j 43081j commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

It is unsafe to change an arrow function's referenced member
expressions. For example:

setTimeout(() => fn(foo.bar), 100); // foo.bar can change before 100ms

It isn't really possible to guess if it is safe without a lot of type
system work so let's just disallow them.

It is unsafe to change an arrow function's referenced member
expressions. For example:

```ts
setTimeout(() => fn(foo.bar), 100); // foo.bar can change before 100ms
```

It isn't really possible to guess if it is safe without a lot of type
system work so let's just disallow them.
@43081j
43081j merged commit 95609af into main Oct 17, 2026
3 checks passed
@43081j
43081j deleted the jg/drop-members branch October 17, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant