swc/crates/swc_ecma_parser/tests/tsc/privateNameInInExpressionUnused.ts
2022-02-04 17:08:38 +09:00

14 lines
293 B
TypeScript

// @strict: true
// @noUnusedLocals: true
// @target: esnext, es2022
class Foo {
#unused: undefined; // expect unused error
#brand: undefined; // expect no error
isFoo(v: any): v is Foo {
// This should count as using/reading '#brand'
return #brand in v;
}
}