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

Open
dsherret opened this issue Feb 10, 2024 · 0 comments
Open

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

dsherret opened this issue Feb 10, 2024 · 0 comments
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

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

No branches or pull requests

2 participants