Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWC should parse yield<T> (v: T)=>v #9914

Open
magic-akari opened this issue Jan 21, 2025 · 1 comment · May be fixed by #9915
Open

SWC should parse yield<T> (v: T)=>v #9914

magic-akari opened this issue Jan 21, 2025 · 1 comment · May be fixed by #9915
Assignees
Labels
Milestone

Comments

@magic-akari
Copy link
Member

magic-akari commented Jan 21, 2025

Describe the bug

sub issue of #9878

Input code

(function* () {
    yield <T>(v: T) => v;
});

Config

{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": false
    },
    "target": "es2022"
  },
  "module": {
    "type": "es6"
  },
  "minify": false,
  "isModule": true
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.10.9&code=H4sIAAAAAAAAA9NIK81LLsnMz9NS0NBUqOZSAILKzNScFAWbEDuNMiuFEE0FWzuFMmuuWk1rAMYyBAQtAAAA&config=H4sIAAAAAAAAA02NOQ6EMAxF%2B5wick2BUlBwBw4RgUFBLJFtpIkQd58kkBk6%2F%2FcXn0prmLmHVp%2FxjMJbYqSfjoTDJvYTCUjwyD05L1AVVzhZo10YM7puB8TShJJayKY2BtTjwboPx4L%2Fj2n1zjWvkNvcGMpyRo670hQ6UF1fU15err0AAAA%3D

SWC Info output

No response

Expected behavior

SWC should parse successfully.

Actual behavior

No response

Version

all

Additional context

No response

@magic-akari magic-akari self-assigned this Jan 21, 2025
@kdy1 kdy1 added this to the Planned milestone Jan 21, 2025
@magic-akari magic-akari linked a pull request Jan 21, 2025 that will close this issue
@magic-akari
Copy link
Member Author

Investigation: When JSX/TSX is enabled, this code can be correctly parsed.

CC @kdy1 Do you have any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants