mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 06:36:08 +03:00
24 lines
427 B
TypeScript
24 lines
427 B
TypeScript
// @strict: true
|
|
// @target: es6
|
|
|
|
class A {
|
|
#fooField = 3;
|
|
#fooMethod() { };
|
|
get #fooProp() { return 1; };
|
|
set #fooProp(value: number) { };
|
|
bar = 3;
|
|
baz = 3;
|
|
}
|
|
|
|
// `keyof A` should not include '#foo*'
|
|
let k: keyof A = "bar"; // OK
|
|
k = "baz"; // OK
|
|
|
|
k = "#fooField"; // Error
|
|
k = "#fooMethod"; // Error
|
|
k = "#fooProp"; // Error
|
|
|
|
k = "fooField"; // Error
|
|
k = "fooMethod"; // Error
|
|
k = "fooProp"; // Error
|