Skip to content

fix: print the type parameters of object-literal methods - #184

Merged
dummdidumm merged 2 commits into
sveltejs:mainfrom
leonidaz:fix/object-method-type-parameters
Sep 3, 2026
Merged

dummdidumm merged 2 commits into
sveltejs:mainfrom
leonidaz:fix/object-method-type-parameters

Conversation

@leonidaz

@leonidaz leonidaz commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Split out of #183 at the maintainers' request.

Object-literal methods lost their type parameters when printed: { m<T>(x: T) {} } came out as { m(x: T) {} }. The Property visitor's method branch never visited value.typeParameters.

The test parses with oxc because acorn-typescript cannot parse type parameters on object-literal methods.

🤖 Generated with Claude Code

`{ m<T>(x: T) {} }` was printed as `{ m(x: T) {} }`: the `Property`
visitor never visited `value.typeParameters`.
@pkg-svelte-dev

pkg-svelte-dev Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Install the latest version of esrap from d7d5282:

pnpm add https://pkg.svelte.dev/esrap/c/d7d52825751c814bdd769a390b0dc33af69ad546

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/esrap/pr/184

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d7d5282

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
esrap Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dummdidumm
dummdidumm merged commit ba2b98b into sveltejs:main Sep 3, 2026
6 checks passed
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.

2 participants