Repository navigation
typescript: a class property initialised with an arrow is a method named for its field - #1787
Merged
Merged
Conversation
…med for its field
`handler = () => {…}` was indexed as Svc.<arrow> beside a field Svc.handler, so
this.handler(), which the engine resolves to the arrow, never reached Svc.handler
(the caller showed only as [in scope]). The field's initializer is the arrow's
expression row, whose anonymousDeclarationHash is the method: name it for the
field, as const foo = () => … already is. The bound field or variable row is
dropped by its own line, so a property written over several lines is one member.
A property whose initializer is a call wrapping an arrow stays a field.
Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
swapnilpaliwal-sd
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
September 29, 2026 06:57
swapnilpaliwal-sd
added a commit
that referenced
this pull request
Sep 29, 2026
Conflict in axiomcode-index with #1787: keep 0.1.9's field-bound names and this branch's member names; the owner line stays this branch's. Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last open resolver rule from #636: a class property initialised with an arrow (
handler = () => {…}) was indexed asSvc.<arrow>next to a fieldSvc.handler, sothis.handler(), which the engine resolves to the arrow, only reachedSvc.handleras[in scope].initializerExpressionLinkHash→ the expression'sanonymousDeclarationHash), the same wayconst foo = () => …is already handled.throttled = debounce(() => …)stays a field.tests/cases/typescript/class-property-arrow(2/5 before, 5/5 after).pipeline-array-dispatchis marked pending but passes; JSfield-initializer-is-a-siblingandwrapped-handler-route).Closes #636