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

Bun is unable to parse override in constructor parameters #7324

Closed
bgenia opened this issue Nov 26, 2023 · 0 comments · Fixed by #7330
Closed

Bun is unable to parse override in constructor parameters #7324

bgenia opened this issue Nov 26, 2023 · 0 comments · Fixed by #7330
Labels
bug Something isn't working transpiler parser || printer

Comments

@bgenia
Copy link

bgenia commented Nov 26, 2023

What version of Bun is running?

1.0.14+d8be3e51b

What platform is your computer?

Linux 5.10.102.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

Run the following TS code:

class FooParent {}

class FooChild extends FooParent { }

class BarParent {
    constructor(readonly foo: FooParent) {}
}

class BarChild extends BarParent {
	constructor(override foo: FooChild) {
		super(foo)
	}
}

new BarChild(new FooChild())

What is the expected behavior?

This is valid TypeScript and tsc compiles it just fine, I expect bun to do the same

What do you see instead?

10 |    constructor(override foo: FooChild) {
                           ^
error: Expected ")" but found "foo"
    at example.ts:10:23 176

10 |    constructor(override foo: FooChild) {
                                        ^
error: Expected ";" but found ")"
    at example.ts:10:36 189

10 |    constructor(override foo: FooChild) {
                                          ^
error: Expected identifier but found "{"
    at example.ts:10:38 191

13 | }
     ^
error: Unexpected }
    at example.ts:13:1 209

Additional information

No response

@bgenia bgenia added the bug Something isn't working label Nov 26, 2023
Jarred-Sumner added a commit that referenced this issue Nov 27, 2023
@Electroid Electroid added the transpiler parser || printer label Nov 27, 2023
dylan-conway pushed a commit that referenced this issue Nov 27, 2023
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
cirospaciari pushed a commit that referenced this issue Nov 27, 2023
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
ryoppippi pushed a commit to ryoppippi/bun that referenced this issue Feb 1, 2024
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working transpiler parser || printer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants