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

TS instantiation followed by satisfies or "as" expr fails to parse #8627

Closed
dsherret opened this issue Feb 10, 2024 · 1 comment · Fixed by #9583
Closed

TS instantiation followed by satisfies or "as" expr fails to parse #8627

dsherret opened this issue Feb 10, 2024 · 1 comment · Fixed by #9583
Labels
Milestone

Comments

@dsherret
Copy link
Contributor

dsherret commented Feb 10, 2024

Describe the bug

It seems a satisfies or "as" expr fails to parse if preceeded by a TS instantiation.

Input code

Array<5> as unknown;

Or:

Array<5> satisfies unknown;

Config

No response

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.4.1-nightly-20240210.1&code=H4sIAAAAAAAAA3MsKkqstDG1U0gsVijNy87LL8%2Bz5uUCAIBwXDoWAAAA&config=H4sIAAAAAAAAA1WPSw7CMAxE9z1F5DVbWHAHDhEFtwrKT7ErEVW9O%2FkDu%2FjNTMY%2BFiHgRQru4sjPPAQZCeOcM6HkWL4zAU4BSUUdGC5DZSoSxx0rOZsALOOGXEJI1%2B4G4z1hZqs0hJ1Z7fSafvuUtyEi0b%2BxWKXbzMy3uqVXgvXPvYr9jrJrq7%2FB1zTK5seg6TGS9YjzA2yuiPwTAQAA

SWC Info output

1.4.1-nightly-20240210.1

Expected behavior

Should parse

Actual behavior

error: The module's source code could not be parsed: Expected ';', '}' or <eof> at file:///redacted/type_tests.ts:1:20

  Array<5> satisfies unknown;
                     ~~~~~~~

Version

1.4.1-nightly-20240210.1

Additional context

No response

@swc-bot
Copy link
Collaborator

swc-bot commented Nov 7, 2024

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants