Skip to content

Fix compiler error when exporting integers while emitting tsd#26590

Open
jeremy-code wants to merge 1 commit into
emscripten-core:mainfrom
jeremy-code:main
Open

Fix compiler error when exporting integers while emitting tsd#26590
jeremy-code wants to merge 1 commit into
emscripten-core:mainfrom
jeremy-code:main

Conversation

@jeremy-code

@jeremy-code jeremy-code commented Apr 1, 2026

Copy link
Copy Markdown

Replaces concatenation (which can error when snippet is an int) with f-string

Fixes: #26589

@sbc100

sbc100 commented Apr 1, 2026

Copy link
Copy Markdown
Collaborator

Looks like you need to use different quotes on the inside and outside here.

Also, can out add a test.

@brendandahl would likely know where best to add this.

@brendandahl

Copy link
Copy Markdown
Collaborator

Adding a test here would be good.

@sbc100

sbc100 commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

Did you mean to close this out?

@jeremy-code jeremy-code reopened this Apr 3, 2026
Comment thread test/test_other.py Outdated
self.get_cflags())
self.assertFileContents(test_file('other/test_emit_tsd_integer.d.ts'), read_file('test_emit_tsd_integer.d.ts'))
cmd = shared.get_npm_cmd('tsc') + [test_file('other/test_tsd_integer.ts'), '--noEmit']
shared.check_call(cmd)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we maybe just add an integer to one of the existing tests?

@sbc100

sbc100 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Also, could you update the PR title so it clear what area of the codebase this effect? Perhaps something like "Fix ?? error/crash in td.d generation"

@jeremy-code jeremy-code changed the title Format snippet with f-string Fix compiler error when exporting integers while emitting tsd Jun 12, 2026
- Fixes emscripten-core#26589
- Replaces concatenation (which can error when snippet is an int) with f-string
- Update test_other.py to include POINTER_SIZE
@sbc100 sbc100 enabled auto-merge (squash) June 12, 2026 03:47
@sbc100 sbc100 disabled auto-merge June 12, 2026 03:47
@sbc100 sbc100 enabled auto-merge (squash) June 12, 2026 03:47
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.

Emitting TSD errors when exporting POINTER_SIZE

3 participants