Skip to content

Commit

Permalink
Fixes #7324 (#7330)
Browse files Browse the repository at this point in the history
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
  • Loading branch information
Jarred-Sumner and Jarred-Sumner authored Nov 27, 2023
1 parent 1840de3 commit 6ee42f7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/js_lexer_tables.zig
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,12 @@ pub const PropertyModifierKeyword = enum {
});
};

pub const TypeScriptAccessibilityModifier = ComptimeStringMap(u1, .{
.{ "private", 1 },
.{ "protected", 1 },
.{ "public", 1 },
.{ "readonly", 1 },
pub const TypeScriptAccessibilityModifier = ComptimeStringMap(void, .{
.{ "override", void },
.{ "private", void },
.{ "protected", void },
.{ "public", void },
.{ "readonly", void },
});

pub const TokenEnumType = std.EnumArray(T, []u8);
Expand Down
21 changes: 21 additions & 0 deletions test/transpiler/7324.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { test, expect } from "bun:test";

test("override is an accessibility modifier", () => {
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());

expect().pass();
});

0 comments on commit 6ee42f7

Please sign in to comment.