Files
tsgo/testdata/baselines/reference/submodule/compiler/checkJsObjectLiteralHasCheckedKeyof.symbols
2025-02-26 14:53:49 -08:00

25 lines
468 B
Plaintext

//// [tests/cases/compiler/checkJsObjectLiteralHasCheckedKeyof.ts] ////
=== file.js ===
// @ts-check
const obj = {
>obj : Symbol(obj, Decl(file.js, 1, 5))
x: 1,
>x : Symbol(x, Decl(file.js, 1, 13))
y: 2
>y : Symbol(y, Decl(file.js, 2, 9))
};
/**
* @type {keyof typeof obj}
*/
let selected = "x";
>selected : Symbol(selected, Decl(file.js, 9, 3))
selected = "z"; // should fail
>selected : Symbol(selected, Decl(file.js, 9, 3))