mirror of
https://github.com/hanzoai/swc.git
synced 2026-10-30 19:42:53 +00:00
## Summary
In TSX mode, `<T>() => {}` is ambiguous with JSX syntax and should be
rejected. TypeScript requires disambiguation using either:
- A trailing comma: `<T,>() => {}`
- A constraint: `<T extends unknown>() => {}`
- Multiple type parameters: `<T, U>() => {}`
Closes #10598
## Test plan
- [x] Added unit tests for valid and invalid TSX syntax
- [x] Updated existing fixture tests to use valid TSX syntax
- [x] All parser tests passing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Donny/강동윤 <[email protected]>