diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 4140f49f9a6f4..269ab0b915931 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2235,7 +2235,7 @@ namespace ts { error(errorLocation, Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), declarationNameToString(errorLocation as Identifier)); } } - if (result && errorLocation && meaning & SymbolFlags.Value && result.flags & SymbolFlags.Alias && !(result.flags & SymbolFlags.Value) && !isValidTypeOnlyAliasUseSite(errorLocation)) { + if (result && errorLocation && meaning & SymbolFlags.Value && result.flags & SymbolFlags.Alias && !(result.flags & SymbolFlags.Value) && !isValidTypeOnlyAliasUseSite(errorLocation) && (compilerOptions.isolatedModules || !isConstEnumOrConstEnumOnlyModule(resolveAlias(result)))) { const typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result); if (typeOnlyDeclaration) { const message = typeOnlyDeclaration.kind === SyntaxKind.ExportSpecifier diff --git a/tests/baselines/reference/classStaticBlock22.errors.txt b/tests/baselines/reference/classStaticBlock22.errors.txt deleted file mode 100644 index cb89b33e3bc3b..0000000000000 --- a/tests/baselines/reference/classStaticBlock22.errors.txt +++ /dev/null @@ -1,94 +0,0 @@ -tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts(4,9): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts(7,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts(13,9): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts(16,14): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts(19,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts(29,15): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts(32,12): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - - -==== tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts (7 errors) ==== - let await: "any"; - class C { - static { - let await: any; // illegal, cannot declare a new binding for await - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - } - static { - let { await } = {} as any; // illegal, cannot declare a new binding for await - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - } - static { - let { await: other } = {} as any; // legal - } - static { - let await; // illegal, cannot declare a new binding for await - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - } - static { - function await() { }; // illegal - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - } - static { - class await { }; // illegal - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - } - - static { - class D { - await = 1; // legal - x = await; // legal (initializers have an implicit function boundary) - }; - } - static { - (function await() { }); // legal, 'await' in function expression name not bound inside of static block - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - } - static { - (class await { }); // legal, 'await' in class expression name not bound inside of static block - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - } - static { - (function () { return await; }); // legal, 'await' is inside of a new function boundary - } - static { - (() => await); // legal, 'await' is inside of a new function boundary - } - - static { - class E { - constructor() { await; } - method() { await; } - get accessor() { - await; - return 1; - } - set accessor(v: any) { - await; - } - propLambda = () => { await; } - propFunc = function () { await; } - } - } - static { - class S { - static method() { await; } - static get accessor() { - await; - return 1; - } - static set accessor(v: any) { - await; - } - static propLambda = () => { await; } - static propFunc = function () { await; } - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlock22.js b/tests/baselines/reference/classStaticBlock22.js deleted file mode 100644 index bed746875acdf..0000000000000 --- a/tests/baselines/reference/classStaticBlock22.js +++ /dev/null @@ -1,146 +0,0 @@ -//// [classStaticBlock22.ts] -let await: "any"; -class C { - static { - let await: any; // illegal, cannot declare a new binding for await - } - static { - let { await } = {} as any; // illegal, cannot declare a new binding for await - } - static { - let { await: other } = {} as any; // legal - } - static { - let await; // illegal, cannot declare a new binding for await - } - static { - function await() { }; // illegal - } - static { - class await { }; // illegal - } - - static { - class D { - await = 1; // legal - x = await; // legal (initializers have an implicit function boundary) - }; - } - static { - (function await() { }); // legal, 'await' in function expression name not bound inside of static block - } - static { - (class await { }); // legal, 'await' in class expression name not bound inside of static block - } - static { - (function () { return await; }); // legal, 'await' is inside of a new function boundary - } - static { - (() => await); // legal, 'await' is inside of a new function boundary - } - - static { - class E { - constructor() { await; } - method() { await; } - get accessor() { - await; - return 1; - } - set accessor(v: any) { - await; - } - propLambda = () => { await; } - propFunc = function () { await; } - } - } - static { - class S { - static method() { await; } - static get accessor() { - await; - return 1; - } - static set accessor(v: any) { - await; - } - static propLambda = () => { await; } - static propFunc = function () { await; } - } - } -} - -//// [classStaticBlock22.js] -let await; -class C { - static { - let await; // illegal, cannot declare a new binding for await - } - static { - let { await } = {}; // illegal, cannot declare a new binding for await - } - static { - let { await: other } = {}; // legal - } - static { - let await; // illegal, cannot declare a new binding for await - } - static { - function await() { } - ; // illegal - } - static { - class await { - } - ; // illegal - } - static { - class D { - await = 1; // legal - x = await; // legal (initializers have an implicit function boundary) - } - ; - } - static { - (function await() { }); // legal, 'await' in function expression name not bound inside of static block - } - static { - (class await { - }); // legal, 'await' in class expression name not bound inside of static block - } - static { - (function () { return await; }); // legal, 'await' is inside of a new function boundary - } - static { - (() => await); // legal, 'await' is inside of a new function boundary - } - static { - class E { - constructor() { await; } - method() { await; } - get accessor() { - await; - return 1; - } - set accessor(v) { - await; - } - propLambda = () => { await; }; - propFunc = function () { await; }; - } - } - static { - class S { - static method() { await; } - static get accessor() { - await; - return 1; - } - static set accessor(v) { - await; - } - static propLambda = () => { await; }; - static propFunc = function () { await; }; - } - } -} diff --git a/tests/baselines/reference/classStaticBlock22.symbols b/tests/baselines/reference/classStaticBlock22.symbols deleted file mode 100644 index 9f78f245322f3..0000000000000 --- a/tests/baselines/reference/classStaticBlock22.symbols +++ /dev/null @@ -1,130 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts === -let await: "any"; ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - -class C { ->C : Symbol(C, Decl(classStaticBlock22.ts, 0, 17)) - - static { - let await: any; // illegal, cannot declare a new binding for await ->await : Symbol(await, Decl(classStaticBlock22.ts, 3, 7)) - } - static { - let { await } = {} as any; // illegal, cannot declare a new binding for await ->await : Symbol(await, Decl(classStaticBlock22.ts, 6, 9)) - } - static { - let { await: other } = {} as any; // legal ->other : Symbol(other, Decl(classStaticBlock22.ts, 9, 9)) - } - static { - let await; // illegal, cannot declare a new binding for await ->await : Symbol(await, Decl(classStaticBlock22.ts, 12, 7)) - } - static { - function await() { }; // illegal ->await : Symbol(await, Decl(classStaticBlock22.ts, 14, 10)) - } - static { - class await { }; // illegal ->await : Symbol(await, Decl(classStaticBlock22.ts, 17, 10)) - } - - static { - class D { ->D : Symbol(D, Decl(classStaticBlock22.ts, 21, 10)) - - await = 1; // legal ->await : Symbol(D.await, Decl(classStaticBlock22.ts, 22, 13)) - - x = await; // legal (initializers have an implicit function boundary) ->x : Symbol(D.x, Decl(classStaticBlock22.ts, 23, 16)) ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - - }; - } - static { - (function await() { }); // legal, 'await' in function expression name not bound inside of static block ->await : Symbol(await, Decl(classStaticBlock22.ts, 28, 5)) - } - static { - (class await { }); // legal, 'await' in class expression name not bound inside of static block ->await : Symbol(await, Decl(classStaticBlock22.ts, 31, 5)) - } - static { - (function () { return await; }); // legal, 'await' is inside of a new function boundary ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - } - static { - (() => await); // legal, 'await' is inside of a new function boundary ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - } - - static { - class E { ->E : Symbol(E, Decl(classStaticBlock22.ts, 40, 10)) - - constructor() { await; } ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - - method() { await; } ->method : Symbol(E.method, Decl(classStaticBlock22.ts, 42, 30)) ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - - get accessor() { ->accessor : Symbol(E.accessor, Decl(classStaticBlock22.ts, 43, 25), Decl(classStaticBlock22.ts, 47, 7)) - - await; ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - - return 1; - } - set accessor(v: any) { ->accessor : Symbol(E.accessor, Decl(classStaticBlock22.ts, 43, 25), Decl(classStaticBlock22.ts, 47, 7)) ->v : Symbol(v, Decl(classStaticBlock22.ts, 48, 19)) - - await; ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - } - propLambda = () => { await; } ->propLambda : Symbol(E.propLambda, Decl(classStaticBlock22.ts, 50, 7)) ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - - propFunc = function () { await; } ->propFunc : Symbol(E.propFunc, Decl(classStaticBlock22.ts, 51, 35)) ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - } - } - static { - class S { ->S : Symbol(S, Decl(classStaticBlock22.ts, 55, 10)) - - static method() { await; } ->method : Symbol(S.method, Decl(classStaticBlock22.ts, 56, 13)) ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - - static get accessor() { ->accessor : Symbol(S.accessor, Decl(classStaticBlock22.ts, 57, 32), Decl(classStaticBlock22.ts, 61, 7)) - - await; ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - - return 1; - } - static set accessor(v: any) { ->accessor : Symbol(S.accessor, Decl(classStaticBlock22.ts, 57, 32), Decl(classStaticBlock22.ts, 61, 7)) ->v : Symbol(v, Decl(classStaticBlock22.ts, 62, 26)) - - await; ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - } - static propLambda = () => { await; } ->propLambda : Symbol(S.propLambda, Decl(classStaticBlock22.ts, 64, 7)) ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - - static propFunc = function () { await; } ->propFunc : Symbol(S.propFunc, Decl(classStaticBlock22.ts, 65, 42)) ->await : Symbol(await, Decl(classStaticBlock22.ts, 0, 3)) - } - } -} diff --git a/tests/baselines/reference/classStaticBlock22.types b/tests/baselines/reference/classStaticBlock22.types deleted file mode 100644 index 8334f1b584217..0000000000000 --- a/tests/baselines/reference/classStaticBlock22.types +++ /dev/null @@ -1,150 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock22.ts === -let await: "any"; ->await : "any" - -class C { ->C : C - - static { - let await: any; // illegal, cannot declare a new binding for await ->await : any - } - static { - let { await } = {} as any; // illegal, cannot declare a new binding for await ->await : any ->{} as any : any ->{} : {} - } - static { - let { await: other } = {} as any; // legal ->await : any ->other : any ->{} as any : any ->{} : {} - } - static { - let await; // illegal, cannot declare a new binding for await ->await : any - } - static { - function await() { }; // illegal ->await : () => void - } - static { - class await { }; // illegal ->await : await - } - - static { - class D { ->D : D - - await = 1; // legal ->await : number ->1 : 1 - - x = await; // legal (initializers have an implicit function boundary) ->x : "any" ->await : "any" - - }; - } - static { - (function await() { }); // legal, 'await' in function expression name not bound inside of static block ->(function await() { }) : () => void ->function await() { } : () => void ->await : () => void - } - static { - (class await { }); // legal, 'await' in class expression name not bound inside of static block ->(class await { }) : typeof await ->class await { } : typeof await ->await : typeof await - } - static { - (function () { return await; }); // legal, 'await' is inside of a new function boundary ->(function () { return await; }) : () => "any" ->function () { return await; } : () => "any" ->await : "any" - } - static { - (() => await); // legal, 'await' is inside of a new function boundary ->(() => await) : () => "any" ->() => await : () => "any" ->await : "any" - } - - static { - class E { ->E : E - - constructor() { await; } ->await : "any" - - method() { await; } ->method : () => void ->await : "any" - - get accessor() { ->accessor : any - - await; ->await : "any" - - return 1; ->1 : 1 - } - set accessor(v: any) { ->accessor : any ->v : any - - await; ->await : "any" - } - propLambda = () => { await; } ->propLambda : () => void ->() => { await; } : () => void ->await : "any" - - propFunc = function () { await; } ->propFunc : () => void ->function () { await; } : () => void ->await : "any" - } - } - static { - class S { ->S : S - - static method() { await; } ->method : () => void ->await : "any" - - static get accessor() { ->accessor : any - - await; ->await : "any" - - return 1; ->1 : 1 - } - static set accessor(v: any) { ->accessor : any ->v : any - - await; ->await : "any" - } - static propLambda = () => { await; } ->propLambda : () => void ->() => { await; } : () => void ->await : "any" - - static propFunc = function () { await; } ->propFunc : () => void ->function () { await; } : () => void ->await : "any" - } - } -} diff --git a/tests/baselines/reference/classStaticBlock23.errors.txt b/tests/baselines/reference/classStaticBlock23.errors.txt deleted file mode 100644 index eee258b4a5b12..0000000000000 --- a/tests/baselines/reference/classStaticBlock23.errors.txt +++ /dev/null @@ -1,28 +0,0 @@ -tests/cases/conformance/classes/classStaticBlock/classStaticBlock23.ts(5,9): error TS18038: 'For await' loops cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock23.ts(14,11): error TS18038: 'For await' loops cannot be used inside a class static block. - - -==== tests/cases/conformance/classes/classStaticBlock/classStaticBlock23.ts (2 errors) ==== - const nums = [1, 2, 3].map(n => Promise.resolve(n)) - - class C { - static { - for await (const nn of nums) { - ~~~~~ -!!! error TS18038: 'For await' loops cannot be used inside a class static block. - console.log(nn) - } - } - } - - async function foo () { - class C { - static { - for await (const nn of nums) { - ~~~~~ -!!! error TS18038: 'For await' loops cannot be used inside a class static block. - console.log(nn) - } - } - } - } \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlock23.js b/tests/baselines/reference/classStaticBlock23.js deleted file mode 100644 index ae72a288a2bab..0000000000000 --- a/tests/baselines/reference/classStaticBlock23.js +++ /dev/null @@ -1,39 +0,0 @@ -//// [classStaticBlock23.ts] -const nums = [1, 2, 3].map(n => Promise.resolve(n)) - -class C { - static { - for await (const nn of nums) { - console.log(nn) - } - } -} - -async function foo () { - class C { - static { - for await (const nn of nums) { - console.log(nn) - } - } - } -} - -//// [classStaticBlock23.js] -const nums = [1, 2, 3].map(n => Promise.resolve(n)); -class C { - static { - for await (const nn of nums) { - console.log(nn); - } - } -} -async function foo() { - class C { - static { - for await (const nn of nums) { - console.log(nn); - } - } - } -} diff --git a/tests/baselines/reference/classStaticBlock23.symbols b/tests/baselines/reference/classStaticBlock23.symbols deleted file mode 100644 index 39771ac55fbab..0000000000000 --- a/tests/baselines/reference/classStaticBlock23.symbols +++ /dev/null @@ -1,48 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock23.ts === -const nums = [1, 2, 3].map(n => Promise.resolve(n)) ->nums : Symbol(nums, Decl(classStaticBlock23.ts, 0, 5)) ->[1, 2, 3].map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --)) ->n : Symbol(n, Decl(classStaticBlock23.ts, 0, 27)) ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->n : Symbol(n, Decl(classStaticBlock23.ts, 0, 27)) - -class C { ->C : Symbol(C, Decl(classStaticBlock23.ts, 0, 51)) - - static { - for await (const nn of nums) { ->nn : Symbol(nn, Decl(classStaticBlock23.ts, 4, 20)) ->nums : Symbol(nums, Decl(classStaticBlock23.ts, 0, 5)) - - console.log(nn) ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->nn : Symbol(nn, Decl(classStaticBlock23.ts, 4, 20)) - } - } -} - -async function foo () { ->foo : Symbol(foo, Decl(classStaticBlock23.ts, 8, 1)) - - class C { ->C : Symbol(C, Decl(classStaticBlock23.ts, 10, 23)) - - static { - for await (const nn of nums) { ->nn : Symbol(nn, Decl(classStaticBlock23.ts, 13, 22)) ->nums : Symbol(nums, Decl(classStaticBlock23.ts, 0, 5)) - - console.log(nn) ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->nn : Symbol(nn, Decl(classStaticBlock23.ts, 13, 22)) - } - } - } -} diff --git a/tests/baselines/reference/classStaticBlock23.types b/tests/baselines/reference/classStaticBlock23.types deleted file mode 100644 index 379a40f31c5d1..0000000000000 --- a/tests/baselines/reference/classStaticBlock23.types +++ /dev/null @@ -1,57 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock23.ts === -const nums = [1, 2, 3].map(n => Promise.resolve(n)) ->nums : Promise[] ->[1, 2, 3].map(n => Promise.resolve(n)) : Promise[] ->[1, 2, 3].map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] ->[1, 2, 3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 ->map : (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[] ->n => Promise.resolve(n) : (n: number) => Promise ->n : number ->Promise.resolve(n) : Promise ->Promise.resolve : { (): Promise; (value: T | PromiseLike): Promise; } ->Promise : PromiseConstructor ->resolve : { (): Promise; (value: T | PromiseLike): Promise; } ->n : number - -class C { ->C : C - - static { - for await (const nn of nums) { ->nn : number ->nums : Promise[] - - console.log(nn) ->console.log(nn) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->nn : number - } - } -} - -async function foo () { ->foo : () => Promise - - class C { ->C : C - - static { - for await (const nn of nums) { ->nn : number ->nums : Promise[] - - console.log(nn) ->console.log(nn) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->nn : number - } - } - } -} diff --git a/tests/baselines/reference/classStaticBlock25.js b/tests/baselines/reference/classStaticBlock25.js deleted file mode 100644 index 79864030028c1..0000000000000 --- a/tests/baselines/reference/classStaticBlock25.js +++ /dev/null @@ -1,44 +0,0 @@ -//// [classStaticBlock25.ts] -const a = 1; -const b = 2; - -class C { - static { - const a = 11; - - a; - b; - } - - static { - const a = 11; - - a; - b; - } -} - - -//// [classStaticBlock25.js] -const a = 1; -const b = 2; -class C { - static { - const a = 11; - a; - b; - } - static { - const a = 11; - a; - b; - } -} -//# sourceMappingURL=classStaticBlock25.js.map - -//// [classStaticBlock25.d.ts] -declare const a = 1; -declare const b = 2; -declare class C { -} -//# sourceMappingURL=classStaticBlock25.d.ts.map \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlock25.js.map b/tests/baselines/reference/classStaticBlock25.js.map deleted file mode 100644 index f3bccac8cb86f..0000000000000 --- a/tests/baselines/reference/classStaticBlock25.js.map +++ /dev/null @@ -1,7 +0,0 @@ -//// [classStaticBlock25.js.map] -{"version":3,"file":"classStaticBlock25.js","sourceRoot":"","sources":["classStaticBlock25.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,GAAG,CAAC,CAAC;AACZ,MAAM,CAAC,GAAG,CAAC,CAAC;AAEZ,MAAM,CAAC;IACH;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;IAED;QACI,MAAM,CAAC,GAAG,EAAE,CAAC;QAEb,CAAC,CAAC;QACF,CAAC,CAAC;IACN,CAAC;CACJ"} -//// https://sokra.github.io/source-map-visualization#base64,Y29uc3QgYSA9IDE7DQpjb25zdCBiID0gMjsNCmNsYXNzIEMgew0KICAgIHN0YXRpYyB7DQogICAgICAgIGNvbnN0IGEgPSAxMTsNCiAgICAgICAgYTsNCiAgICAgICAgYjsNCiAgICB9DQogICAgc3RhdGljIHsNCiAgICAgICAgY29uc3QgYSA9IDExOw0KICAgICAgICBhOw0KICAgICAgICBiOw0KICAgIH0NCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPWNsYXNzU3RhdGljQmxvY2syNS5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NTdGF0aWNCbG9jazI1LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2xhc3NTdGF0aWNCbG9jazI1LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUNaLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztBQUVaLE1BQU0sQ0FBQztJQUNIO1FBQ0ksTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBRWIsQ0FBQyxDQUFDO1FBQ0YsQ0FBQyxDQUFDO0lBQ04sQ0FBQztJQUVEO1FBQ0ksTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDO1FBRWIsQ0FBQyxDQUFDO1FBQ0YsQ0FBQyxDQUFDO0lBQ04sQ0FBQztDQUNKIn0=,Y29uc3QgYSA9IDE7CmNvbnN0IGIgPSAyOwoKY2xhc3MgQyB7CiAgICBzdGF0aWMgewogICAgICAgIGNvbnN0IGEgPSAxMTsKCiAgICAgICAgYTsKICAgICAgICBiOwogICAgfQoKICAgIHN0YXRpYyB7CiAgICAgICAgY29uc3QgYSA9IDExOwoKICAgICAgICBhOwogICAgICAgIGI7CiAgICB9Cn0K - -//// [classStaticBlock25.d.ts.map] -{"version":3,"file":"classStaticBlock25.d.ts","sourceRoot":"","sources":["classStaticBlock25.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,CAAC,IAAI,CAAC;AACZ,QAAA,MAAM,CAAC,IAAI,CAAC;AAEZ,cAAM,CAAC;CAcN"} -//// https://sokra.github.io/source-map-visualization#base64,ZGVjbGFyZSBjb25zdCBhID0gMTsNCmRlY2xhcmUgY29uc3QgYiA9IDI7DQpkZWNsYXJlIGNsYXNzIEMgew0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y2xhc3NTdGF0aWNCbG9jazI1LmQudHMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NTdGF0aWNCbG9jazI1LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJjbGFzc1N0YXRpY0Jsb2NrMjUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsUUFBQSxNQUFNLENBQUMsSUFBSSxDQUFDO0FBQ1osUUFBQSxNQUFNLENBQUMsSUFBSSxDQUFDO0FBRVosY0FBTSxDQUFDO0NBY04ifQ==,Y29uc3QgYSA9IDE7CmNvbnN0IGIgPSAyOwoKY2xhc3MgQyB7CiAgICBzdGF0aWMgewogICAgICAgIGNvbnN0IGEgPSAxMTsKCiAgICAgICAgYTsKICAgICAgICBiOwogICAgfQoKICAgIHN0YXRpYyB7CiAgICAgICAgY29uc3QgYSA9IDExOwoKICAgICAgICBhOwogICAgICAgIGI7CiAgICB9Cn0K diff --git a/tests/baselines/reference/classStaticBlock25.sourcemap.txt b/tests/baselines/reference/classStaticBlock25.sourcemap.txt deleted file mode 100644 index 91f7b7913f116..0000000000000 --- a/tests/baselines/reference/classStaticBlock25.sourcemap.txt +++ /dev/null @@ -1,287 +0,0 @@ -=================================================================== -JsFile: classStaticBlock25.js -mapUrl: classStaticBlock25.js.map -sourceRoot: -sources: classStaticBlock25.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:tests/cases/conformance/classes/classStaticBlock/classStaticBlock25.js -sourceFile:classStaticBlock25.ts -------------------------------------------------------------------- ->>>const a = 1; -1 > -2 >^^^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ -7 > ^-> -1 > -2 >const -3 > a -4 > = -5 > 1 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 7) Source(1, 7) + SourceIndex(0) -3 >Emitted(1, 8) Source(1, 8) + SourceIndex(0) -4 >Emitted(1, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(1, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 13) Source(1, 13) + SourceIndex(0) ---- ->>>const b = 2; -1-> -2 >^^^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ -1-> - > -2 >const -3 > b -4 > = -5 > 2 -6 > ; -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 7) Source(2, 7) + SourceIndex(0) -3 >Emitted(2, 8) Source(2, 8) + SourceIndex(0) -4 >Emitted(2, 11) Source(2, 11) + SourceIndex(0) -5 >Emitted(2, 12) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 13) Source(2, 13) + SourceIndex(0) ---- ->>>class C { -1 > -2 >^^^^^^ -3 > ^ -4 > ^^^^^^-> -1 > - > - > -2 >class -3 > C -1 >Emitted(3, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(3, 7) Source(4, 7) + SourceIndex(0) -3 >Emitted(3, 8) Source(4, 8) + SourceIndex(0) ---- ->>> static { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^-> -1-> { - > -1->Emitted(4, 5) Source(5, 5) + SourceIndex(0) ---- ->>> const a = 11; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^ -5 > ^^ -6 > ^ -1->static { - > -2 > const -3 > a -4 > = -5 > 11 -6 > ; -1->Emitted(5, 9) Source(6, 9) + SourceIndex(0) -2 >Emitted(5, 15) Source(6, 15) + SourceIndex(0) -3 >Emitted(5, 16) Source(6, 16) + SourceIndex(0) -4 >Emitted(5, 19) Source(6, 19) + SourceIndex(0) -5 >Emitted(5, 21) Source(6, 21) + SourceIndex(0) -6 >Emitted(5, 22) Source(6, 22) + SourceIndex(0) ---- ->>> a; -1 >^^^^^^^^ -2 > ^ -3 > ^ -4 > ^-> -1 > - > - > -2 > a -3 > ; -1 >Emitted(6, 9) Source(8, 9) + SourceIndex(0) -2 >Emitted(6, 10) Source(8, 10) + SourceIndex(0) -3 >Emitted(6, 11) Source(8, 11) + SourceIndex(0) ---- ->>> b; -1->^^^^^^^^ -2 > ^ -3 > ^ -1-> - > -2 > b -3 > ; -1->Emitted(7, 9) Source(9, 9) + SourceIndex(0) -2 >Emitted(7, 10) Source(9, 10) + SourceIndex(0) -3 >Emitted(7, 11) Source(9, 11) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -3 > ^^^^^^^^-> -1 > - > -2 > } -1 >Emitted(8, 5) Source(10, 5) + SourceIndex(0) -2 >Emitted(8, 6) Source(10, 6) + SourceIndex(0) ---- ->>> static { -1->^^^^ -2 > ^^^^^^^^^^^^^^^^^^-> -1-> - > - > -1->Emitted(9, 5) Source(12, 5) + SourceIndex(0) ---- ->>> const a = 11; -1->^^^^^^^^ -2 > ^^^^^^ -3 > ^ -4 > ^^^ -5 > ^^ -6 > ^ -1->static { - > -2 > const -3 > a -4 > = -5 > 11 -6 > ; -1->Emitted(10, 9) Source(13, 9) + SourceIndex(0) -2 >Emitted(10, 15) Source(13, 15) + SourceIndex(0) -3 >Emitted(10, 16) Source(13, 16) + SourceIndex(0) -4 >Emitted(10, 19) Source(13, 19) + SourceIndex(0) -5 >Emitted(10, 21) Source(13, 21) + SourceIndex(0) -6 >Emitted(10, 22) Source(13, 22) + SourceIndex(0) ---- ->>> a; -1 >^^^^^^^^ -2 > ^ -3 > ^ -4 > ^-> -1 > - > - > -2 > a -3 > ; -1 >Emitted(11, 9) Source(15, 9) + SourceIndex(0) -2 >Emitted(11, 10) Source(15, 10) + SourceIndex(0) -3 >Emitted(11, 11) Source(15, 11) + SourceIndex(0) ---- ->>> b; -1->^^^^^^^^ -2 > ^ -3 > ^ -1-> - > -2 > b -3 > ; -1->Emitted(12, 9) Source(16, 9) + SourceIndex(0) -2 >Emitted(12, 10) Source(16, 10) + SourceIndex(0) -3 >Emitted(12, 11) Source(16, 11) + SourceIndex(0) ---- ->>> } -1 >^^^^ -2 > ^ -1 > - > -2 > } -1 >Emitted(13, 5) Source(17, 5) + SourceIndex(0) -2 >Emitted(13, 6) Source(17, 6) + SourceIndex(0) ---- ->>>} -1 >^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - >} -1 >Emitted(14, 2) Source(18, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=classStaticBlock25.js.map=================================================================== -JsFile: classStaticBlock25.d.ts -mapUrl: classStaticBlock25.d.ts.map -sourceRoot: -sources: classStaticBlock25.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:tests/cases/conformance/classes/classStaticBlock/classStaticBlock25.d.ts -sourceFile:classStaticBlock25.ts -------------------------------------------------------------------- ->>>declare const a = 1; -1 > -2 >^^^^^^^^ -3 > ^^^^^^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^-> -1 > -2 > -3 > const -4 > a -5 > = 1 -6 > ; -1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(1, 9) Source(1, 1) + SourceIndex(0) -3 >Emitted(1, 15) Source(1, 7) + SourceIndex(0) -4 >Emitted(1, 16) Source(1, 8) + SourceIndex(0) -5 >Emitted(1, 20) Source(1, 12) + SourceIndex(0) -6 >Emitted(1, 21) Source(1, 13) + SourceIndex(0) ---- ->>>declare const b = 2; -1-> -2 >^^^^^^^^ -3 > ^^^^^^ -4 > ^ -5 > ^^^^ -6 > ^ -1-> - > -2 > -3 > const -4 > b -5 > = 2 -6 > ; -1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(2, 9) Source(2, 1) + SourceIndex(0) -3 >Emitted(2, 15) Source(2, 7) + SourceIndex(0) -4 >Emitted(2, 16) Source(2, 8) + SourceIndex(0) -5 >Emitted(2, 20) Source(2, 12) + SourceIndex(0) -6 >Emitted(2, 21) Source(2, 13) + SourceIndex(0) ---- ->>>declare class C { -1 > -2 >^^^^^^^^^^^^^^ -3 > ^ -1 > - > - > -2 >class -3 > C -1 >Emitted(3, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(3, 15) Source(4, 7) + SourceIndex(0) -3 >Emitted(3, 16) Source(4, 8) + SourceIndex(0) ---- ->>>} -1 >^ -2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > { - > static { - > const a = 11; - > - > a; - > b; - > } - > - > static { - > const a = 11; - > - > a; - > b; - > } - >} -1 >Emitted(4, 2) Source(18, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=classStaticBlock25.d.ts.map \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlock25.symbols b/tests/baselines/reference/classStaticBlock25.symbols deleted file mode 100644 index 034fa041ed6d4..0000000000000 --- a/tests/baselines/reference/classStaticBlock25.symbols +++ /dev/null @@ -1,33 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock25.ts === -const a = 1; ->a : Symbol(a, Decl(classStaticBlock25.ts, 0, 5)) - -const b = 2; ->b : Symbol(b, Decl(classStaticBlock25.ts, 1, 5)) - -class C { ->C : Symbol(C, Decl(classStaticBlock25.ts, 1, 12)) - - static { - const a = 11; ->a : Symbol(a, Decl(classStaticBlock25.ts, 5, 13)) - - a; ->a : Symbol(a, Decl(classStaticBlock25.ts, 5, 13)) - - b; ->b : Symbol(b, Decl(classStaticBlock25.ts, 1, 5)) - } - - static { - const a = 11; ->a : Symbol(a, Decl(classStaticBlock25.ts, 12, 13)) - - a; ->a : Symbol(a, Decl(classStaticBlock25.ts, 12, 13)) - - b; ->b : Symbol(b, Decl(classStaticBlock25.ts, 1, 5)) - } -} - diff --git a/tests/baselines/reference/classStaticBlock25.types b/tests/baselines/reference/classStaticBlock25.types deleted file mode 100644 index dd78af7dda7e6..0000000000000 --- a/tests/baselines/reference/classStaticBlock25.types +++ /dev/null @@ -1,37 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock25.ts === -const a = 1; ->a : 1 ->1 : 1 - -const b = 2; ->b : 2 ->2 : 2 - -class C { ->C : C - - static { - const a = 11; ->a : 11 ->11 : 11 - - a; ->a : 11 - - b; ->b : 2 - } - - static { - const a = 11; ->a : 11 ->11 : 11 - - a; ->a : 11 - - b; ->b : 2 - } -} - diff --git a/tests/baselines/reference/classStaticBlock26.errors.txt b/tests/baselines/reference/classStaticBlock26.errors.txt deleted file mode 100644 index 3c5eb52fb8f34..0000000000000 --- a/tests/baselines/reference/classStaticBlock26.errors.txt +++ /dev/null @@ -1,86 +0,0 @@ -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(3,9): error TS18037: Await expression cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(3,14): error TS1109: Expression expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(6,9): error TS18037: Await expression cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(9,13): error TS18037: Await expression cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(9,18): error TS1109: Expression expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(13,14): error TS18037: Await expression cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(13,19): error TS1109: Expression expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(17,18): error TS1005: ':' expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(20,9): error TS18037: Await expression cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(20,14): error TS1109: Expression expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(21,15): error TS1003: Identifier expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(21,15): error TS18037: Await expression cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(21,20): error TS1109: Expression expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(25,21): error TS18037: Await expression cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(25,26): error TS1109: Expression expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(25,28): error TS1005: ';' expected. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(26,21): error TS18037: Await expression cannot be used inside a class static block. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts(26,27): error TS1109: Expression expected. - - -==== tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts (18 errors) ==== - class C { - static { - await; // illegal - ~~~~~ -!!! error TS18037: Await expression cannot be used inside a class static block. - ~ -!!! error TS1109: Expression expected. - } - static { - await (1); // illegal - ~~~~~~~~~ -!!! error TS18037: Await expression cannot be used inside a class static block. - } - static { - ({ [await]: 1 }); // illegal - ~~~~~ -!!! error TS18037: Await expression cannot be used inside a class static block. - ~ -!!! error TS1109: Expression expected. - } - static { - class D { - [await] = 1; // illegal (computed property names are evaluated outside of a class body - ~~~~~ -!!! error TS18037: Await expression cannot be used inside a class static block. - ~ -!!! error TS1109: Expression expected. - }; - } - static { - ({ await }); // illegal short-hand property reference - ~ -!!! error TS1005: ':' expected. - } - static { - await: // illegal, 'await' cannot be used as a label - ~~~~~ -!!! error TS18037: Await expression cannot be used inside a class static block. - ~ -!!! error TS1109: Expression expected. - break await; // illegal, 'await' cannot be used as a label - ~~~~~ -!!! error TS1003: Identifier expected. - ~~~~~ -!!! error TS18037: Await expression cannot be used inside a class static block. - ~ -!!! error TS1109: Expression expected. - } - static { - function f(await) { } - const ff = (await) => { } - ~~~~~ -!!! error TS18037: Await expression cannot be used inside a class static block. - ~ -!!! error TS1109: Expression expected. - ~~ -!!! error TS1005: ';' expected. - const fff = await => { } - ~~~~~ -!!! error TS18037: Await expression cannot be used inside a class static block. - ~~ -!!! error TS1109: Expression expected. - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlock26.js b/tests/baselines/reference/classStaticBlock26.js deleted file mode 100644 index ababa6abf24ac..0000000000000 --- a/tests/baselines/reference/classStaticBlock26.js +++ /dev/null @@ -1,64 +0,0 @@ -//// [classStaticBlock26.ts] -class C { - static { - await; // illegal - } - static { - await (1); // illegal - } - static { - ({ [await]: 1 }); // illegal - } - static { - class D { - [await] = 1; // illegal (computed property names are evaluated outside of a class body - }; - } - static { - ({ await }); // illegal short-hand property reference - } - static { - await: // illegal, 'await' cannot be used as a label - break await; // illegal, 'await' cannot be used as a label - } - static { - function f(await) { } - const ff = (await) => { } - const fff = await => { } - } -} - - -//// [classStaticBlock26.js] -class C { - static { - await ; // illegal - } - static { - await (1); // illegal - } - static { - ({ [await ]: 1 }); // illegal - } - static { - class D { - [await ] = 1; // illegal (computed property names are evaluated outside of a class body - } - ; - } - static { - ({ await: }); // illegal short-hand property reference - } - static { - await ; - break ; - await ; // illegal, 'await' cannot be used as a label - } - static { - function f(await) { } - const ff = (await ); - { } - const fff = await ; - { } - } -} diff --git a/tests/baselines/reference/classStaticBlock26.symbols b/tests/baselines/reference/classStaticBlock26.symbols deleted file mode 100644 index 2d3b2717ba213..0000000000000 --- a/tests/baselines/reference/classStaticBlock26.symbols +++ /dev/null @@ -1,44 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts === -class C { ->C : Symbol(C, Decl(classStaticBlock26.ts, 0, 0)) - - static { - await; // illegal - } - static { - await (1); // illegal - } - static { - ({ [await]: 1 }); // illegal ->[await] : Symbol([await], Decl(classStaticBlock26.ts, 8, 10)) - } - static { - class D { ->D : Symbol(D, Decl(classStaticBlock26.ts, 10, 12)) - - [await] = 1; // illegal (computed property names are evaluated outside of a class body ->[await] : Symbol(D[await], Decl(classStaticBlock26.ts, 11, 17)) - - }; - } - static { - ({ await }); // illegal short-hand property reference ->await : Symbol(await, Decl(classStaticBlock26.ts, 16, 10)) - } - static { - await: // illegal, 'await' cannot be used as a label - break await; // illegal, 'await' cannot be used as a label - } - static { - function f(await) { } ->f : Symbol(f, Decl(classStaticBlock26.ts, 22, 12)) ->await : Symbol(await, Decl(classStaticBlock26.ts, 23, 19)) - - const ff = (await) => { } ->ff : Symbol(ff, Decl(classStaticBlock26.ts, 24, 13)) - - const fff = await => { } ->fff : Symbol(fff, Decl(classStaticBlock26.ts, 25, 13)) - } -} - diff --git a/tests/baselines/reference/classStaticBlock26.types b/tests/baselines/reference/classStaticBlock26.types deleted file mode 100644 index 0922330a47533..0000000000000 --- a/tests/baselines/reference/classStaticBlock26.types +++ /dev/null @@ -1,71 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock26.ts === -class C { ->C : C - - static { - await; // illegal ->await : any -> : any - } - static { - await (1); // illegal ->await (1) : 1 ->(1) : 1 ->1 : 1 - } - static { - ({ [await]: 1 }); // illegal ->({ [await]: 1 }) : { [x: number]: number; } ->{ [await]: 1 } : { [x: number]: number; } ->[await] : number ->await : any -> : any ->1 : 1 - } - static { - class D { ->D : D - - [await] = 1; // illegal (computed property names are evaluated outside of a class body ->[await] : number ->await : any -> : any ->1 : 1 - - }; - } - static { - ({ await }); // illegal short-hand property reference ->({ await }) : { await: any; } ->{ await } : { await: any; } ->await : any -> : any - } - static { - await: // illegal, 'await' cannot be used as a label ->await : any -> : any - - break await; // illegal, 'await' cannot be used as a label -> : any ->await : any -> : any - } - static { - function f(await) { } ->f : (await: any) => void ->await : any - - const ff = (await) => { } ->ff : any ->(await) : any ->await : any -> : any - - const fff = await => { } ->fff : any ->await : any -> : any - } -} - diff --git a/tests/baselines/reference/classStaticBlock3.errors.txt b/tests/baselines/reference/classStaticBlock3.errors.txt deleted file mode 100644 index bf01354e1405f..0000000000000 --- a/tests/baselines/reference/classStaticBlock3.errors.txt +++ /dev/null @@ -1,33 +0,0 @@ -tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts(7,29): error TS2729: Property 'f2' is used before its initialization. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts(7,35): error TS2729: Property 'f3' is used before its initialization. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts(13,35): error TS2729: Property 'f3' is used before its initialization. - - -==== tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts (3 errors) ==== - const a = 1; - - class C { - static f1 = 1; - - static { - console.log(C.f1, C.f2, C.f3) - ~~ -!!! error TS2729: Property 'f2' is used before its initialization. -!!! related TS2728 tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts:10:12: 'f2' is declared here. - ~~ -!!! error TS2729: Property 'f3' is used before its initialization. -!!! related TS2728 tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts:16:12: 'f3' is declared here. - } - - static f2 = 2; - - static { - console.log(C.f1, C.f2, C.f3) - ~~ -!!! error TS2729: Property 'f3' is used before its initialization. -!!! related TS2728 tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts:16:12: 'f3' is declared here. - } - - static f3 = 3; - } - \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlock3.js b/tests/baselines/reference/classStaticBlock3.js deleted file mode 100644 index 99fe38cf28e28..0000000000000 --- a/tests/baselines/reference/classStaticBlock3.js +++ /dev/null @@ -1,33 +0,0 @@ -//// [classStaticBlock3.ts] -const a = 1; - -class C { - static f1 = 1; - - static { - console.log(C.f1, C.f2, C.f3) - } - - static f2 = 2; - - static { - console.log(C.f1, C.f2, C.f3) - } - - static f3 = 3; -} - - -//// [classStaticBlock3.js] -const a = 1; -class C { - static f1 = 1; - static { - console.log(C.f1, C.f2, C.f3); - } - static f2 = 2; - static { - console.log(C.f1, C.f2, C.f3); - } - static f3 = 3; -} diff --git a/tests/baselines/reference/classStaticBlock3.symbols b/tests/baselines/reference/classStaticBlock3.symbols deleted file mode 100644 index 758fa0790609a..0000000000000 --- a/tests/baselines/reference/classStaticBlock3.symbols +++ /dev/null @@ -1,49 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts === -const a = 1; ->a : Symbol(a, Decl(classStaticBlock3.ts, 0, 5)) - -class C { ->C : Symbol(C, Decl(classStaticBlock3.ts, 0, 12)) - - static f1 = 1; ->f1 : Symbol(C.f1, Decl(classStaticBlock3.ts, 2, 9)) - - static { - console.log(C.f1, C.f2, C.f3) ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->C.f1 : Symbol(C.f1, Decl(classStaticBlock3.ts, 2, 9)) ->C : Symbol(C, Decl(classStaticBlock3.ts, 0, 12)) ->f1 : Symbol(C.f1, Decl(classStaticBlock3.ts, 2, 9)) ->C.f2 : Symbol(C.f2, Decl(classStaticBlock3.ts, 7, 5)) ->C : Symbol(C, Decl(classStaticBlock3.ts, 0, 12)) ->f2 : Symbol(C.f2, Decl(classStaticBlock3.ts, 7, 5)) ->C.f3 : Symbol(C.f3, Decl(classStaticBlock3.ts, 13, 5)) ->C : Symbol(C, Decl(classStaticBlock3.ts, 0, 12)) ->f3 : Symbol(C.f3, Decl(classStaticBlock3.ts, 13, 5)) - } - - static f2 = 2; ->f2 : Symbol(C.f2, Decl(classStaticBlock3.ts, 7, 5)) - - static { - console.log(C.f1, C.f2, C.f3) ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->C.f1 : Symbol(C.f1, Decl(classStaticBlock3.ts, 2, 9)) ->C : Symbol(C, Decl(classStaticBlock3.ts, 0, 12)) ->f1 : Symbol(C.f1, Decl(classStaticBlock3.ts, 2, 9)) ->C.f2 : Symbol(C.f2, Decl(classStaticBlock3.ts, 7, 5)) ->C : Symbol(C, Decl(classStaticBlock3.ts, 0, 12)) ->f2 : Symbol(C.f2, Decl(classStaticBlock3.ts, 7, 5)) ->C.f3 : Symbol(C.f3, Decl(classStaticBlock3.ts, 13, 5)) ->C : Symbol(C, Decl(classStaticBlock3.ts, 0, 12)) ->f3 : Symbol(C.f3, Decl(classStaticBlock3.ts, 13, 5)) - } - - static f3 = 3; ->f3 : Symbol(C.f3, Decl(classStaticBlock3.ts, 13, 5)) -} - diff --git a/tests/baselines/reference/classStaticBlock3.types b/tests/baselines/reference/classStaticBlock3.types deleted file mode 100644 index d5705a72e8775..0000000000000 --- a/tests/baselines/reference/classStaticBlock3.types +++ /dev/null @@ -1,55 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock3.ts === -const a = 1; ->a : 1 ->1 : 1 - -class C { ->C : C - - static f1 = 1; ->f1 : number ->1 : 1 - - static { - console.log(C.f1, C.f2, C.f3) ->console.log(C.f1, C.f2, C.f3) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->C.f1 : number ->C : typeof C ->f1 : number ->C.f2 : number ->C : typeof C ->f2 : number ->C.f3 : number ->C : typeof C ->f3 : number - } - - static f2 = 2; ->f2 : number ->2 : 2 - - static { - console.log(C.f1, C.f2, C.f3) ->console.log(C.f1, C.f2, C.f3) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->C.f1 : number ->C : typeof C ->f1 : number ->C.f2 : number ->C : typeof C ->f2 : number ->C.f3 : number ->C : typeof C ->f3 : number - } - - static f3 = 3; ->f3 : number ->3 : 3 -} - diff --git a/tests/baselines/reference/classStaticBlock4.errors.txt b/tests/baselines/reference/classStaticBlock4.errors.txt deleted file mode 100644 index d4ec1db72f646..0000000000000 --- a/tests/baselines/reference/classStaticBlock4.errors.txt +++ /dev/null @@ -1,26 +0,0 @@ -tests/cases/conformance/classes/classStaticBlock/classStaticBlock4.ts(8,14): error TS2729: Property 's2' is used before its initialization. -tests/cases/conformance/classes/classStaticBlock/classStaticBlock4.ts(9,11): error TS2729: Property 's2' is used before its initialization. - - -==== tests/cases/conformance/classes/classStaticBlock/classStaticBlock4.ts (2 errors) ==== - class C { - static s1 = 1; - - static { - this.s1; - C.s1; - - this.s2; - ~~ -!!! error TS2729: Property 's2' is used before its initialization. -!!! related TS2728 tests/cases/conformance/classes/classStaticBlock/classStaticBlock4.ts:12:12: 's2' is declared here. - C.s2; - ~~ -!!! error TS2729: Property 's2' is used before its initialization. -!!! related TS2728 tests/cases/conformance/classes/classStaticBlock/classStaticBlock4.ts:12:12: 's2' is declared here. - } - - static s2 = 2; - static ss2 = this.s1; - } - \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlock4.js b/tests/baselines/reference/classStaticBlock4.js deleted file mode 100644 index b8821bc0f36c4..0000000000000 --- a/tests/baselines/reference/classStaticBlock4.js +++ /dev/null @@ -1,29 +0,0 @@ -//// [classStaticBlock4.ts] -class C { - static s1 = 1; - - static { - this.s1; - C.s1; - - this.s2; - C.s2; - } - - static s2 = 2; - static ss2 = this.s1; -} - - -//// [classStaticBlock4.js] -class C { - static s1 = 1; - static { - this.s1; - C.s1; - this.s2; - C.s2; - } - static s2 = 2; - static ss2 = this.s1; -} diff --git a/tests/baselines/reference/classStaticBlock4.symbols b/tests/baselines/reference/classStaticBlock4.symbols deleted file mode 100644 index fd412244fbe0e..0000000000000 --- a/tests/baselines/reference/classStaticBlock4.symbols +++ /dev/null @@ -1,39 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock4.ts === -class C { ->C : Symbol(C, Decl(classStaticBlock4.ts, 0, 0)) - - static s1 = 1; ->s1 : Symbol(C.s1, Decl(classStaticBlock4.ts, 0, 9)) - - static { - this.s1; ->this.s1 : Symbol(C.s1, Decl(classStaticBlock4.ts, 0, 9)) ->this : Symbol(C, Decl(classStaticBlock4.ts, 0, 0)) ->s1 : Symbol(C.s1, Decl(classStaticBlock4.ts, 0, 9)) - - C.s1; ->C.s1 : Symbol(C.s1, Decl(classStaticBlock4.ts, 0, 9)) ->C : Symbol(C, Decl(classStaticBlock4.ts, 0, 0)) ->s1 : Symbol(C.s1, Decl(classStaticBlock4.ts, 0, 9)) - - this.s2; ->this.s2 : Symbol(C.s2, Decl(classStaticBlock4.ts, 9, 5)) ->this : Symbol(C, Decl(classStaticBlock4.ts, 0, 0)) ->s2 : Symbol(C.s2, Decl(classStaticBlock4.ts, 9, 5)) - - C.s2; ->C.s2 : Symbol(C.s2, Decl(classStaticBlock4.ts, 9, 5)) ->C : Symbol(C, Decl(classStaticBlock4.ts, 0, 0)) ->s2 : Symbol(C.s2, Decl(classStaticBlock4.ts, 9, 5)) - } - - static s2 = 2; ->s2 : Symbol(C.s2, Decl(classStaticBlock4.ts, 9, 5)) - - static ss2 = this.s1; ->ss2 : Symbol(C.ss2, Decl(classStaticBlock4.ts, 11, 18)) ->this.s1 : Symbol(C.s1, Decl(classStaticBlock4.ts, 0, 9)) ->this : Symbol(C, Decl(classStaticBlock4.ts, 0, 0)) ->s1 : Symbol(C.s1, Decl(classStaticBlock4.ts, 0, 9)) -} - diff --git a/tests/baselines/reference/classStaticBlock4.types b/tests/baselines/reference/classStaticBlock4.types deleted file mode 100644 index db068a795397c..0000000000000 --- a/tests/baselines/reference/classStaticBlock4.types +++ /dev/null @@ -1,41 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlock4.ts === -class C { ->C : C - - static s1 = 1; ->s1 : number ->1 : 1 - - static { - this.s1; ->this.s1 : number ->this : typeof C ->s1 : number - - C.s1; ->C.s1 : number ->C : typeof C ->s1 : number - - this.s2; ->this.s2 : number ->this : typeof C ->s2 : number - - C.s2; ->C.s2 : number ->C : typeof C ->s2 : number - } - - static s2 = 2; ->s2 : number ->2 : 2 - - static ss2 = this.s1; ->ss2 : number ->this.s1 : number ->this : typeof C ->s1 : number -} - diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef1.symbols b/tests/baselines/reference/classStaticBlockUseBeforeDef1.symbols deleted file mode 100644 index 3a432e830e4b1..0000000000000 --- a/tests/baselines/reference/classStaticBlockUseBeforeDef1.symbols +++ /dev/null @@ -1,32 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef1.ts === -class C { ->C : Symbol(C, Decl(classStaticBlockUseBeforeDef1.ts, 0, 0)) - - static x; ->x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef1.ts, 0, 9)) - - static { - this.x = 1; ->this.x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef1.ts, 0, 9)) ->this : Symbol(C, Decl(classStaticBlockUseBeforeDef1.ts, 0, 0)) ->x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef1.ts, 0, 9)) - } - static y = this.x; ->y : Symbol(C.y, Decl(classStaticBlockUseBeforeDef1.ts, 4, 5)) ->this.x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef1.ts, 0, 9)) ->this : Symbol(C, Decl(classStaticBlockUseBeforeDef1.ts, 0, 0)) ->x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef1.ts, 0, 9)) - - static z; ->z : Symbol(C.z, Decl(classStaticBlockUseBeforeDef1.ts, 5, 22)) - - static { - this.z = this.y; ->this.z : Symbol(C.z, Decl(classStaticBlockUseBeforeDef1.ts, 5, 22)) ->this : Symbol(C, Decl(classStaticBlockUseBeforeDef1.ts, 0, 0)) ->z : Symbol(C.z, Decl(classStaticBlockUseBeforeDef1.ts, 5, 22)) ->this.y : Symbol(C.y, Decl(classStaticBlockUseBeforeDef1.ts, 4, 5)) ->this : Symbol(C, Decl(classStaticBlockUseBeforeDef1.ts, 0, 0)) ->y : Symbol(C.y, Decl(classStaticBlockUseBeforeDef1.ts, 4, 5)) - } -} diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef1.types b/tests/baselines/reference/classStaticBlockUseBeforeDef1.types deleted file mode 100644 index 084534b0a169f..0000000000000 --- a/tests/baselines/reference/classStaticBlockUseBeforeDef1.types +++ /dev/null @@ -1,35 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef1.ts === -class C { ->C : C - - static x; ->x : number - - static { - this.x = 1; ->this.x = 1 : 1 ->this.x : number ->this : typeof C ->x : number ->1 : 1 - } - static y = this.x; ->y : number ->this.x : number ->this : typeof C ->x : number - - static z; ->z : number - - static { - this.z = this.y; ->this.z = this.y : number ->this.z : number ->this : typeof C ->z : number ->this.y : number ->this : typeof C ->y : number - } -} diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef2.errors.txt b/tests/baselines/reference/classStaticBlockUseBeforeDef2.errors.txt deleted file mode 100644 index ca13946d6230a..0000000000000 --- a/tests/baselines/reference/classStaticBlockUseBeforeDef2.errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef2.ts(3,14): error TS2729: Property 'x' is used before its initialization. - - -==== tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef2.ts (1 errors) ==== - class C { - static { - this.x = 1; - ~ -!!! error TS2729: Property 'x' is used before its initialization. -!!! related TS2728 tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef2.ts:5:12: 'x' is declared here. - } - static x; - } \ No newline at end of file diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef2.symbols b/tests/baselines/reference/classStaticBlockUseBeforeDef2.symbols deleted file mode 100644 index 69716958faa82..0000000000000 --- a/tests/baselines/reference/classStaticBlockUseBeforeDef2.symbols +++ /dev/null @@ -1,13 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef2.ts === -class C { ->C : Symbol(C, Decl(classStaticBlockUseBeforeDef2.ts, 0, 0)) - - static { - this.x = 1; ->this.x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef2.ts, 3, 5)) ->this : Symbol(C, Decl(classStaticBlockUseBeforeDef2.ts, 0, 0)) ->x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef2.ts, 3, 5)) - } - static x; ->x : Symbol(C.x, Decl(classStaticBlockUseBeforeDef2.ts, 3, 5)) -} diff --git a/tests/baselines/reference/classStaticBlockUseBeforeDef2.types b/tests/baselines/reference/classStaticBlockUseBeforeDef2.types deleted file mode 100644 index 660b09c8d25b1..0000000000000 --- a/tests/baselines/reference/classStaticBlockUseBeforeDef2.types +++ /dev/null @@ -1,15 +0,0 @@ -=== tests/cases/conformance/classes/classStaticBlock/classStaticBlockUseBeforeDef2.ts === -class C { ->C : C - - static { - this.x = 1; ->this.x = 1 : 1 ->this.x : number ->this : typeof C ->x : number ->1 : 1 - } - static x; ->x : number -} diff --git a/tests/baselines/reference/enums.errors.txt b/tests/baselines/reference/enums.errors.txt index 8644a4dd172e2..19c0f41d7ea92 100644 --- a/tests/baselines/reference/enums.errors.txt +++ b/tests/baselines/reference/enums.errors.txt @@ -1,5 +1,4 @@ /b.ts(3,1): error TS1361: 'SyntaxKind' cannot be used as a value because it was imported using 'import type'. -/b.ts(4,1): error TS1361: 'SymbolFlags' cannot be used as a value because it was imported using 'import type'. ==== /a.ts (0 errors) ==== @@ -16,7 +15,7 @@ export type { SyntaxKind }; export { SymbolFlags }; -==== /b.ts (2 errors) ==== +==== /b.ts (1 errors) ==== import type { SyntaxKind, SymbolFlags } from './a'; SyntaxKind.ImportClause; @@ -24,9 +23,6 @@ !!! error TS1361: 'SyntaxKind' cannot be used as a value because it was imported using 'import type'. !!! related TS1376 /b.ts:1:15: 'SyntaxKind' was imported here. SymbolFlags.Type; - ~~~~~~~~~~~ -!!! error TS1361: 'SymbolFlags' cannot be used as a value because it was imported using 'import type'. -!!! related TS1376 /b.ts:1:27: 'SymbolFlags' was imported here. let kind: SyntaxKind.ImportClause; let flags: SymbolFlags; diff --git a/tests/baselines/reference/plainJSModuleStrict.errors.txt b/tests/baselines/reference/plainJSModuleStrict.errors.txt deleted file mode 100644 index fa3b605f9ed12..0000000000000 --- a/tests/baselines/reference/plainJSModuleStrict.errors.txt +++ /dev/null @@ -1,37 +0,0 @@ -tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(1,1): error TS2528: A module cannot have multiple default exports. -tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(2,1): error TS2528: A module cannot have multiple default exports. -tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(3,7): error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module. -tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(4,7): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. -tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(6,11): error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. -tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js(9,11): error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. - - -==== tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js (6 errors) ==== - export default 12 - ~~~~~~~~~~~~~~~~~ -!!! error TS2528: A module cannot have multiple default exports. -!!! related TS2753 tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js:2:1: Another export default is here. - export default 13 - ~~~~~~~~~~~~~~~~~ -!!! error TS2528: A module cannot have multiple default exports. -!!! related TS2752 tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js:1:1: The first export default is here. - const await = 1 - ~~~~~ -!!! error TS1262: Identifier expected. 'await' is a reserved word at the top-level of a module. - const yield = 2 - ~~~~~ -!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. - async function f() { - const await = 3 - ~~~~~ -!!! error TS1359: Identifier expected. 'await' is a reserved word that cannot be used here. - } - function* g() { - const yield = 4 - ~~~~~ -!!! error TS1214: Identifier expected. 'yield' is a reserved word in strict mode. Modules are automatically in strict mode. - } - class C { - #constructor = 1 - } - \ No newline at end of file diff --git a/tests/baselines/reference/plainJSModuleStrict.js b/tests/baselines/reference/plainJSModuleStrict.js deleted file mode 100644 index 4a6d28c392d6d..0000000000000 --- a/tests/baselines/reference/plainJSModuleStrict.js +++ /dev/null @@ -1,30 +0,0 @@ -//// [plainJSMultipleDefaultExport.js] -export default 12 -export default 13 -const await = 1 -const yield = 2 -async function f() { - const await = 3 -} -function* g() { - const yield = 4 -} -class C { - #constructor = 1 -} - - -//// [plainJSMultipleDefaultExport.js] -export default 12; -export default 13; -const await = 1; -const yield = 2; -async function f() { - const await = 3; -} -function* g() { - const yield = 4; -} -class C { - #constructor = 1; -} diff --git a/tests/baselines/reference/plainJSModuleStrict.symbols b/tests/baselines/reference/plainJSModuleStrict.symbols deleted file mode 100644 index 2b572478c42aa..0000000000000 --- a/tests/baselines/reference/plainJSModuleStrict.symbols +++ /dev/null @@ -1,28 +0,0 @@ -=== tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js === -export default 12 -export default 13 -const await = 1 ->await : Symbol(await, Decl(plainJSMultipleDefaultExport.js, 2, 5)) - -const yield = 2 ->yield : Symbol(yield, Decl(plainJSMultipleDefaultExport.js, 3, 5)) - -async function f() { ->f : Symbol(f, Decl(plainJSMultipleDefaultExport.js, 3, 15)) - - const await = 3 ->await : Symbol(await, Decl(plainJSMultipleDefaultExport.js, 5, 9)) -} -function* g() { ->g : Symbol(g, Decl(plainJSMultipleDefaultExport.js, 6, 1)) - - const yield = 4 ->yield : Symbol(yield, Decl(plainJSMultipleDefaultExport.js, 8, 9)) -} -class C { ->C : Symbol(C, Decl(plainJSMultipleDefaultExport.js, 9, 1)) - - #constructor = 1 ->#constructor : Symbol(C.#constructor, Decl(plainJSMultipleDefaultExport.js, 10, 9)) -} - diff --git a/tests/baselines/reference/plainJSModuleStrict.types b/tests/baselines/reference/plainJSModuleStrict.types deleted file mode 100644 index 51d45840d0fd5..0000000000000 --- a/tests/baselines/reference/plainJSModuleStrict.types +++ /dev/null @@ -1,33 +0,0 @@ -=== tests/cases/conformance/salsa/plainJSMultipleDefaultExport.js === -export default 12 -export default 13 -const await = 1 ->await : 1 ->1 : 1 - -const yield = 2 ->yield : 2 ->2 : 2 - -async function f() { ->f : () => Promise - - const await = 3 ->await : 3 ->3 : 3 -} -function* g() { ->g : () => Generator - - const yield = 4 ->yield : 4 ->4 : 4 -} -class C { ->C : C - - #constructor = 1 ->#constructor : number ->1 : 1 -} - diff --git a/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.js b/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.js deleted file mode 100644 index 7caa9fd353c2e..0000000000000 --- a/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [privateNameBadSuperUseDefineForClassFields.ts] -class B {}; -class A extends B { - #x; - constructor() { - void 0; - super(); - } -} - - -//// [privateNameBadSuperUseDefineForClassFields.js] -class B { -} -; -class A extends B { - #x; - constructor() { - void 0; - super(); - } -} diff --git a/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.symbols b/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.symbols deleted file mode 100644 index 69e98a20656fb..0000000000000 --- a/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.symbols +++ /dev/null @@ -1,18 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameBadSuperUseDefineForClassFields.ts === -class B {}; ->B : Symbol(B, Decl(privateNameBadSuperUseDefineForClassFields.ts, 0, 0)) - -class A extends B { ->A : Symbol(A, Decl(privateNameBadSuperUseDefineForClassFields.ts, 0, 11)) ->B : Symbol(B, Decl(privateNameBadSuperUseDefineForClassFields.ts, 0, 0)) - - #x; ->#x : Symbol(A.#x, Decl(privateNameBadSuperUseDefineForClassFields.ts, 1, 19)) - - constructor() { - void 0; - super(); ->super : Symbol(B, Decl(privateNameBadSuperUseDefineForClassFields.ts, 0, 0)) - } -} - diff --git a/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.types b/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.types deleted file mode 100644 index f4cc919839b20..0000000000000 --- a/tests/baselines/reference/privateNameBadSuperUseDefineForClassFields.types +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameBadSuperUseDefineForClassFields.ts === -class B {}; ->B : B - -class A extends B { ->A : A ->B : B - - #x; ->#x : any - - constructor() { - void 0; ->void 0 : undefined ->0 : 0 - - super(); ->super() : void ->super : typeof B - } -} - diff --git a/tests/baselines/reference/privateNameFieldsESNext.errors.txt b/tests/baselines/reference/privateNameFieldsESNext.errors.txt deleted file mode 100644 index 10288bc30085d..0000000000000 --- a/tests/baselines/reference/privateNameFieldsESNext.errors.txt +++ /dev/null @@ -1,29 +0,0 @@ -tests/cases/conformance/classes/members/privateNames/privateNameFieldsESNext.ts(8,9): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/classes/members/privateNames/privateNameFieldsESNext.ts(11,17): error TS2805: Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag. - - -==== tests/cases/conformance/classes/members/privateNames/privateNameFieldsESNext.ts (2 errors) ==== - class C { - a = 123; - #a = 10; - c = "hello"; - #b; - method() { - console.log(this.#a); - this.#a = "hello"; - ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. - console.log(this.#b); - } - static #m = "test"; - ~~~~~~ -!!! error TS2805: Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag. - static #x; - static test() { - console.log(this.#m); - console.log(this.#x = "test"); - } - #something = () => 1234; - } - - \ No newline at end of file diff --git a/tests/baselines/reference/privateNameFieldsESNext.js b/tests/baselines/reference/privateNameFieldsESNext.js deleted file mode 100644 index acc37caa3cc8f..0000000000000 --- a/tests/baselines/reference/privateNameFieldsESNext.js +++ /dev/null @@ -1,46 +0,0 @@ -//// [privateNameFieldsESNext.ts] -class C { - a = 123; - #a = 10; - c = "hello"; - #b; - method() { - console.log(this.#a); - this.#a = "hello"; - console.log(this.#b); - } - static #m = "test"; - static #x; - static test() { - console.log(this.#m); - console.log(this.#x = "test"); - } - #something = () => 1234; -} - - - -//// [privateNameFieldsESNext.js] -class C { - constructor() { - this.a = 123; - this.#a = 10; - this.c = "hello"; - this.#something = () => 1234; - } - #a; - #b; - method() { - console.log(this.#a); - this.#a = "hello"; - console.log(this.#b); - } - static #m; - static #x; - static test() { - console.log(this.#m); - console.log(this.#x = "test"); - } - #something; -} -C.#m = "test"; diff --git a/tests/baselines/reference/privateNameFieldsESNext.symbols b/tests/baselines/reference/privateNameFieldsESNext.symbols deleted file mode 100644 index 5ed63d12d2fef..0000000000000 --- a/tests/baselines/reference/privateNameFieldsESNext.symbols +++ /dev/null @@ -1,65 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameFieldsESNext.ts === -class C { ->C : Symbol(C, Decl(privateNameFieldsESNext.ts, 0, 0)) - - a = 123; ->a : Symbol(C.a, Decl(privateNameFieldsESNext.ts, 0, 9)) - - #a = 10; ->#a : Symbol(C.#a, Decl(privateNameFieldsESNext.ts, 1, 12)) - - c = "hello"; ->c : Symbol(C.c, Decl(privateNameFieldsESNext.ts, 2, 12)) - - #b; ->#b : Symbol(C.#b, Decl(privateNameFieldsESNext.ts, 3, 16)) - - method() { ->method : Symbol(C.method, Decl(privateNameFieldsESNext.ts, 4, 7)) - - console.log(this.#a); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->this.#a : Symbol(C.#a, Decl(privateNameFieldsESNext.ts, 1, 12)) ->this : Symbol(C, Decl(privateNameFieldsESNext.ts, 0, 0)) - - this.#a = "hello"; ->this.#a : Symbol(C.#a, Decl(privateNameFieldsESNext.ts, 1, 12)) ->this : Symbol(C, Decl(privateNameFieldsESNext.ts, 0, 0)) - - console.log(this.#b); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->this.#b : Symbol(C.#b, Decl(privateNameFieldsESNext.ts, 3, 16)) ->this : Symbol(C, Decl(privateNameFieldsESNext.ts, 0, 0)) - } - static #m = "test"; ->#m : Symbol(C.#m, Decl(privateNameFieldsESNext.ts, 9, 5)) - - static #x; ->#x : Symbol(C.#x, Decl(privateNameFieldsESNext.ts, 10, 23)) - - static test() { ->test : Symbol(C.test, Decl(privateNameFieldsESNext.ts, 11, 14)) - - console.log(this.#m); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->this.#m : Symbol(C.#m, Decl(privateNameFieldsESNext.ts, 9, 5)) ->this : Symbol(C, Decl(privateNameFieldsESNext.ts, 0, 0)) - - console.log(this.#x = "test"); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->this.#x : Symbol(C.#x, Decl(privateNameFieldsESNext.ts, 10, 23)) ->this : Symbol(C, Decl(privateNameFieldsESNext.ts, 0, 0)) - } - #something = () => 1234; ->#something : Symbol(C.#something, Decl(privateNameFieldsESNext.ts, 15, 5)) -} - - diff --git a/tests/baselines/reference/privateNameFieldsESNext.types b/tests/baselines/reference/privateNameFieldsESNext.types deleted file mode 100644 index 8496622cbe357..0000000000000 --- a/tests/baselines/reference/privateNameFieldsESNext.types +++ /dev/null @@ -1,79 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameFieldsESNext.ts === -class C { ->C : C - - a = 123; ->a : number ->123 : 123 - - #a = 10; ->#a : number ->10 : 10 - - c = "hello"; ->c : string ->"hello" : "hello" - - #b; ->#b : any - - method() { ->method : () => void - - console.log(this.#a); ->console.log(this.#a) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->this.#a : number ->this : this - - this.#a = "hello"; ->this.#a = "hello" : "hello" ->this.#a : number ->this : this ->"hello" : "hello" - - console.log(this.#b); ->console.log(this.#b) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->this.#b : any ->this : this - } - static #m = "test"; ->#m : string ->"test" : "test" - - static #x; ->#x : any - - static test() { ->test : () => void - - console.log(this.#m); ->console.log(this.#m) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->this.#m : string ->this : typeof C - - console.log(this.#x = "test"); ->console.log(this.#x = "test") : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->this.#x = "test" : "test" ->this.#x : any ->this : typeof C ->"test" : "test" - } - #something = () => 1234; ->#something : () => number ->() => 1234 : () => number ->1234 : 1234 -} - - diff --git a/tests/baselines/reference/privateNameInInExpression.errors.txt b/tests/baselines/reference/privateNameInInExpression.errors.txt deleted file mode 100644 index 514d2a85e84a6..0000000000000 --- a/tests/baselines/reference/privateNameInInExpression.errors.txt +++ /dev/null @@ -1,140 +0,0 @@ -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(21,29): error TS2571: Object is of type 'unknown'. -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(23,19): error TS2339: Property '#fiel' does not exist on type 'any'. -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(25,20): error TS1451: Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(27,14): error TS2406: The left-hand side of a 'for...in' statement must be a variable or a property access. -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(29,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type 'boolean'. -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(43,27): error TS2531: Object is possibly 'null'. -tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts(114,12): error TS18016: Private identifiers are not allowed outside class bodies. - - -==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts (7 errors) ==== - class Foo { - #field = 1; - static #staticField = 2; - #method() {} - static #staticMethod() {} - - goodRhs(v: any) { - const a = #field in v; - - const b = #field in v.p1.p2; - - const c = #field in (v as {}); - - const d = #field in (v as Foo); - - const e = #field in (v as never); - - for (let f in #field in v as any) { /**/ } // unlikely but valid - } - badRhs(v: any) { - const a = #field in (v as unknown); // Bad - RHS of in must be object type or any - ~~~~~~~~~~~~~~ -!!! error TS2571: Object is of type 'unknown'. - - const b = #fiel in v; // Bad - typo in privateID - ~~~~~ -!!! error TS2339: Property '#fiel' does not exist on type 'any'. - - const c = (#field) in v; // Bad - privateID is not an expression on its own - ~~~~~~ -!!! error TS1451: Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression - - for (#field in v) { /**/ } // Bad - 'in' not allowed - ~~~~~~ -!!! error TS2406: The left-hand side of a 'for...in' statement must be a variable or a property access. - - for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any - ~~~~~~~~~~~ -!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type 'boolean'. - } - whitespace(v: any) { - const a = v && /*0*/#field/*1*/ - /*2*/in/*3*/ - /*4*/v/*5*/ - } - flow(u: unknown, n: never, fb: Foo | Bar, fs: FooSub, b: Bar, fsb: FooSub | Bar, fsfb: Foo | FooSub | Bar) { - - if (typeof u === 'object') { - if (#field in n) { - n; // good n is never - } - - if (#field in u) { - ~ -!!! error TS2531: Object is possibly 'null'. - u; // good u is Foo - } else { - u; // good u is object | null - } - - if (u !== null) { - if (#field in u) { - u; // good u is Foo - } else { - u; // good u is object - } - - if (#method in u) { - u; // good u is Foo - } - - if (#staticField in u) { - u; // good u is typeof Foo - } - - if (#staticMethod in u) { - u; // good u is typeof Foo - } - } - } - - if (#field in fb) { - fb; // good fb is Foo - } else { - fb; // good fb is Bar - } - - if (#field in fs) { - fs; // good fs is FooSub - } else { - fs; // good fs is never - } - - if (#field in b) { - b; // good b is 'Bar & Foo' - } else { - b; // good b is Bar - } - - if (#field in fsb) { - fsb; // good fsb is FooSub - } else { - fsb; // good fsb is Bar - } - - if (#field in fsfb) { - fsfb; // good fsfb is 'Foo | FooSub' - } else { - fsfb; // good fsfb is Bar - } - - class Nested { - m(v: any) { - if (#field in v) { - v; // good v is Foo - } - } - } - } - } - - class FooSub extends Foo { subTypeOfFoo = true } - class Bar { notFoo = true } - - function badSyntax(v: Foo) { - return #field in v; // Bad - outside of class - ~~~~~~ -!!! error TS18016: Private identifiers are not allowed outside class bodies. - } - \ No newline at end of file diff --git a/tests/baselines/reference/privateNameInInExpression.js b/tests/baselines/reference/privateNameInInExpression.js deleted file mode 100644 index a57d640c8d664..0000000000000 --- a/tests/baselines/reference/privateNameInInExpression.js +++ /dev/null @@ -1,222 +0,0 @@ -//// [privateNameInInExpression.ts] -class Foo { - #field = 1; - static #staticField = 2; - #method() {} - static #staticMethod() {} - - goodRhs(v: any) { - const a = #field in v; - - const b = #field in v.p1.p2; - - const c = #field in (v as {}); - - const d = #field in (v as Foo); - - const e = #field in (v as never); - - for (let f in #field in v as any) { /**/ } // unlikely but valid - } - badRhs(v: any) { - const a = #field in (v as unknown); // Bad - RHS of in must be object type or any - - const b = #fiel in v; // Bad - typo in privateID - - const c = (#field) in v; // Bad - privateID is not an expression on its own - - for (#field in v) { /**/ } // Bad - 'in' not allowed - - for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any - } - whitespace(v: any) { - const a = v && /*0*/#field/*1*/ - /*2*/in/*3*/ - /*4*/v/*5*/ - } - flow(u: unknown, n: never, fb: Foo | Bar, fs: FooSub, b: Bar, fsb: FooSub | Bar, fsfb: Foo | FooSub | Bar) { - - if (typeof u === 'object') { - if (#field in n) { - n; // good n is never - } - - if (#field in u) { - u; // good u is Foo - } else { - u; // good u is object | null - } - - if (u !== null) { - if (#field in u) { - u; // good u is Foo - } else { - u; // good u is object - } - - if (#method in u) { - u; // good u is Foo - } - - if (#staticField in u) { - u; // good u is typeof Foo - } - - if (#staticMethod in u) { - u; // good u is typeof Foo - } - } - } - - if (#field in fb) { - fb; // good fb is Foo - } else { - fb; // good fb is Bar - } - - if (#field in fs) { - fs; // good fs is FooSub - } else { - fs; // good fs is never - } - - if (#field in b) { - b; // good b is 'Bar & Foo' - } else { - b; // good b is Bar - } - - if (#field in fsb) { - fsb; // good fsb is FooSub - } else { - fsb; // good fsb is Bar - } - - if (#field in fsfb) { - fsfb; // good fsfb is 'Foo | FooSub' - } else { - fsfb; // good fsfb is Bar - } - - class Nested { - m(v: any) { - if (#field in v) { - v; // good v is Foo - } - } - } - } -} - -class FooSub extends Foo { subTypeOfFoo = true } -class Bar { notFoo = true } - -function badSyntax(v: Foo) { - return #field in v; // Bad - outside of class -} - - -//// [privateNameInInExpression.js] -"use strict"; -class Foo { - #field = 1; - static #staticField = 2; - #method() { } - static #staticMethod() { } - goodRhs(v) { - const a = #field in v; - const b = #field in v.p1.p2; - const c = #field in v; - const d = #field in v; - const e = #field in v; - for (let f in #field in v) { /**/ } // unlikely but valid - } - badRhs(v) { - const a = #field in v; // Bad - RHS of in must be object type or any - const b = #fiel in v; // Bad - typo in privateID - const c = (#field) in v; // Bad - privateID is not an expression on its own - for (#field in v) { /**/ } // Bad - 'in' not allowed - for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any - } - whitespace(v) { - const a = v && /*0*/ #field /*1*/ - /*2*/ in /*3*/ - /*4*/ v; /*5*/ - } - flow(u, n, fb, fs, b, fsb, fsfb) { - if (typeof u === 'object') { - if (#field in n) { - n; // good n is never - } - if (#field in u) { - u; // good u is Foo - } - else { - u; // good u is object | null - } - if (u !== null) { - if (#field in u) { - u; // good u is Foo - } - else { - u; // good u is object - } - if (#method in u) { - u; // good u is Foo - } - if (#staticField in u) { - u; // good u is typeof Foo - } - if (#staticMethod in u) { - u; // good u is typeof Foo - } - } - } - if (#field in fb) { - fb; // good fb is Foo - } - else { - fb; // good fb is Bar - } - if (#field in fs) { - fs; // good fs is FooSub - } - else { - fs; // good fs is never - } - if (#field in b) { - b; // good b is 'Bar & Foo' - } - else { - b; // good b is Bar - } - if (#field in fsb) { - fsb; // good fsb is FooSub - } - else { - fsb; // good fsb is Bar - } - if (#field in fsfb) { - fsfb; // good fsfb is 'Foo | FooSub' - } - else { - fsfb; // good fsfb is Bar - } - class Nested { - m(v) { - if (#field in v) { - v; // good v is Foo - } - } - } - } -} -class FooSub extends Foo { - subTypeOfFoo = true; -} -class Bar { - notFoo = true; -} -function badSyntax(v) { - return #field in v; // Bad - outside of class -} diff --git a/tests/baselines/reference/privateNameInInExpression.symbols b/tests/baselines/reference/privateNameInInExpression.symbols deleted file mode 100644 index 2827e42d11150..0000000000000 --- a/tests/baselines/reference/privateNameInInExpression.symbols +++ /dev/null @@ -1,269 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts === -class Foo { ->Foo : Symbol(Foo, Decl(privateNameInInExpression.ts, 0, 0)) - - #field = 1; ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) - - static #staticField = 2; ->#staticField : Symbol(Foo.#staticField, Decl(privateNameInInExpression.ts, 1, 15)) - - #method() {} ->#method : Symbol(Foo.#method, Decl(privateNameInInExpression.ts, 2, 28)) - - static #staticMethod() {} ->#staticMethod : Symbol(Foo.#staticMethod, Decl(privateNameInInExpression.ts, 3, 16)) - - goodRhs(v: any) { ->goodRhs : Symbol(Foo.goodRhs, Decl(privateNameInInExpression.ts, 4, 29)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 6, 12)) - - const a = #field in v; ->a : Symbol(a, Decl(privateNameInInExpression.ts, 7, 13)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 6, 12)) - - const b = #field in v.p1.p2; ->b : Symbol(b, Decl(privateNameInInExpression.ts, 9, 13)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 6, 12)) - - const c = #field in (v as {}); ->c : Symbol(c, Decl(privateNameInInExpression.ts, 11, 13)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 6, 12)) - - const d = #field in (v as Foo); ->d : Symbol(d, Decl(privateNameInInExpression.ts, 13, 13)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 6, 12)) ->Foo : Symbol(Foo, Decl(privateNameInInExpression.ts, 0, 0)) - - const e = #field in (v as never); ->e : Symbol(e, Decl(privateNameInInExpression.ts, 15, 13)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 6, 12)) - - for (let f in #field in v as any) { /**/ } // unlikely but valid ->f : Symbol(f, Decl(privateNameInInExpression.ts, 17, 16)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 6, 12)) - } - badRhs(v: any) { ->badRhs : Symbol(Foo.badRhs, Decl(privateNameInInExpression.ts, 18, 5)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 19, 11)) - - const a = #field in (v as unknown); // Bad - RHS of in must be object type or any ->a : Symbol(a, Decl(privateNameInInExpression.ts, 20, 13)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 19, 11)) - - const b = #fiel in v; // Bad - typo in privateID ->b : Symbol(b, Decl(privateNameInInExpression.ts, 22, 13)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 19, 11)) - - const c = (#field) in v; // Bad - privateID is not an expression on its own ->c : Symbol(c, Decl(privateNameInInExpression.ts, 24, 13)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 19, 11)) - - for (#field in v) { /**/ } // Bad - 'in' not allowed ->v : Symbol(v, Decl(privateNameInInExpression.ts, 19, 11)) - - for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any ->d : Symbol(d, Decl(privateNameInInExpression.ts, 28, 16)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 19, 11)) - } - whitespace(v: any) { ->whitespace : Symbol(Foo.whitespace, Decl(privateNameInInExpression.ts, 29, 5)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 30, 15)) - - const a = v && /*0*/#field/*1*/ ->a : Symbol(a, Decl(privateNameInInExpression.ts, 31, 13)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 30, 15)) ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) - - /*2*/in/*3*/ - /*4*/v/*5*/ ->v : Symbol(v, Decl(privateNameInInExpression.ts, 30, 15)) - } - flow(u: unknown, n: never, fb: Foo | Bar, fs: FooSub, b: Bar, fsb: FooSub | Bar, fsfb: Foo | FooSub | Bar) { ->flow : Symbol(Foo.flow, Decl(privateNameInInExpression.ts, 34, 5)) ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) ->n : Symbol(n, Decl(privateNameInInExpression.ts, 35, 20)) ->fb : Symbol(fb, Decl(privateNameInInExpression.ts, 35, 30)) ->Foo : Symbol(Foo, Decl(privateNameInInExpression.ts, 0, 0)) ->Bar : Symbol(Bar, Decl(privateNameInInExpression.ts, 109, 48)) ->fs : Symbol(fs, Decl(privateNameInInExpression.ts, 35, 45)) ->FooSub : Symbol(FooSub, Decl(privateNameInInExpression.ts, 107, 1)) ->b : Symbol(b, Decl(privateNameInInExpression.ts, 35, 57)) ->Bar : Symbol(Bar, Decl(privateNameInInExpression.ts, 109, 48)) ->fsb : Symbol(fsb, Decl(privateNameInInExpression.ts, 35, 65)) ->FooSub : Symbol(FooSub, Decl(privateNameInInExpression.ts, 107, 1)) ->Bar : Symbol(Bar, Decl(privateNameInInExpression.ts, 109, 48)) ->fsfb : Symbol(fsfb, Decl(privateNameInInExpression.ts, 35, 84)) ->Foo : Symbol(Foo, Decl(privateNameInInExpression.ts, 0, 0)) ->FooSub : Symbol(FooSub, Decl(privateNameInInExpression.ts, 107, 1)) ->Bar : Symbol(Bar, Decl(privateNameInInExpression.ts, 109, 48)) - - if (typeof u === 'object') { ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - if (#field in n) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->n : Symbol(n, Decl(privateNameInInExpression.ts, 35, 20)) - - n; // good n is never ->n : Symbol(n, Decl(privateNameInInExpression.ts, 35, 20)) - } - - if (#field in u) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - u; // good u is Foo ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - } else { - u; // good u is object | null ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - } - - if (u !== null) { ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - if (#field in u) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - u; // good u is Foo ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - } else { - u; // good u is object ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - } - - if (#method in u) { ->#method : Symbol(Foo.#method, Decl(privateNameInInExpression.ts, 2, 28)) ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - u; // good u is Foo ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - } - - if (#staticField in u) { ->#staticField : Symbol(Foo.#staticField, Decl(privateNameInInExpression.ts, 1, 15)) ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - u; // good u is typeof Foo ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - } - - if (#staticMethod in u) { ->#staticMethod : Symbol(Foo.#staticMethod, Decl(privateNameInInExpression.ts, 3, 16)) ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - - u; // good u is typeof Foo ->u : Symbol(u, Decl(privateNameInInExpression.ts, 35, 9)) - } - } - } - - if (#field in fb) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->fb : Symbol(fb, Decl(privateNameInInExpression.ts, 35, 30)) - - fb; // good fb is Foo ->fb : Symbol(fb, Decl(privateNameInInExpression.ts, 35, 30)) - - } else { - fb; // good fb is Bar ->fb : Symbol(fb, Decl(privateNameInInExpression.ts, 35, 30)) - } - - if (#field in fs) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->fs : Symbol(fs, Decl(privateNameInInExpression.ts, 35, 45)) - - fs; // good fs is FooSub ->fs : Symbol(fs, Decl(privateNameInInExpression.ts, 35, 45)) - - } else { - fs; // good fs is never ->fs : Symbol(fs, Decl(privateNameInInExpression.ts, 35, 45)) - } - - if (#field in b) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->b : Symbol(b, Decl(privateNameInInExpression.ts, 35, 57)) - - b; // good b is 'Bar & Foo' ->b : Symbol(b, Decl(privateNameInInExpression.ts, 35, 57)) - - } else { - b; // good b is Bar ->b : Symbol(b, Decl(privateNameInInExpression.ts, 35, 57)) - } - - if (#field in fsb) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->fsb : Symbol(fsb, Decl(privateNameInInExpression.ts, 35, 65)) - - fsb; // good fsb is FooSub ->fsb : Symbol(fsb, Decl(privateNameInInExpression.ts, 35, 65)) - - } else { - fsb; // good fsb is Bar ->fsb : Symbol(fsb, Decl(privateNameInInExpression.ts, 35, 65)) - } - - if (#field in fsfb) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->fsfb : Symbol(fsfb, Decl(privateNameInInExpression.ts, 35, 84)) - - fsfb; // good fsfb is 'Foo | FooSub' ->fsfb : Symbol(fsfb, Decl(privateNameInInExpression.ts, 35, 84)) - - } else { - fsfb; // good fsfb is Bar ->fsfb : Symbol(fsfb, Decl(privateNameInInExpression.ts, 35, 84)) - } - - class Nested { ->Nested : Symbol(Nested, Decl(privateNameInInExpression.ts, 97, 9)) - - m(v: any) { ->m : Symbol(Nested.m, Decl(privateNameInInExpression.ts, 99, 22)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 100, 14)) - - if (#field in v) { ->#field : Symbol(Foo.#field, Decl(privateNameInInExpression.ts, 0, 11)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 100, 14)) - - v; // good v is Foo ->v : Symbol(v, Decl(privateNameInInExpression.ts, 100, 14)) - } - } - } - } -} - -class FooSub extends Foo { subTypeOfFoo = true } ->FooSub : Symbol(FooSub, Decl(privateNameInInExpression.ts, 107, 1)) ->Foo : Symbol(Foo, Decl(privateNameInInExpression.ts, 0, 0)) ->subTypeOfFoo : Symbol(FooSub.subTypeOfFoo, Decl(privateNameInInExpression.ts, 109, 26)) - -class Bar { notFoo = true } ->Bar : Symbol(Bar, Decl(privateNameInInExpression.ts, 109, 48)) ->notFoo : Symbol(Bar.notFoo, Decl(privateNameInInExpression.ts, 110, 11)) - -function badSyntax(v: Foo) { ->badSyntax : Symbol(badSyntax, Decl(privateNameInInExpression.ts, 110, 27)) ->v : Symbol(v, Decl(privateNameInInExpression.ts, 112, 19)) ->Foo : Symbol(Foo, Decl(privateNameInInExpression.ts, 0, 0)) - - return #field in v; // Bad - outside of class ->v : Symbol(v, Decl(privateNameInInExpression.ts, 112, 19)) -} - diff --git a/tests/baselines/reference/privateNameInInExpression.types b/tests/baselines/reference/privateNameInInExpression.types deleted file mode 100644 index af1ce8a754f1c..0000000000000 --- a/tests/baselines/reference/privateNameInInExpression.types +++ /dev/null @@ -1,308 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameInInExpression.ts === -class Foo { ->Foo : Foo - - #field = 1; ->#field : number ->1 : 1 - - static #staticField = 2; ->#staticField : number ->2 : 2 - - #method() {} ->#method : () => void - - static #staticMethod() {} ->#staticMethod : () => void - - goodRhs(v: any) { ->goodRhs : (v: any) => void ->v : any - - const a = #field in v; ->a : boolean ->#field in v : boolean ->#field : any ->v : any - - const b = #field in v.p1.p2; ->b : boolean ->#field in v.p1.p2 : boolean ->#field : any ->v.p1.p2 : any ->v.p1 : any ->v : any ->p1 : any ->p2 : any - - const c = #field in (v as {}); ->c : boolean ->#field in (v as {}) : boolean ->#field : any ->(v as {}) : {} ->v as {} : {} ->v : any - - const d = #field in (v as Foo); ->d : boolean ->#field in (v as Foo) : boolean ->#field : any ->(v as Foo) : Foo ->v as Foo : Foo ->v : any - - const e = #field in (v as never); ->e : boolean ->#field in (v as never) : boolean ->#field : any ->(v as never) : never ->v as never : never ->v : any - - for (let f in #field in v as any) { /**/ } // unlikely but valid ->f : string ->#field in v as any : any ->#field in v : boolean ->#field : any ->v : any - } - badRhs(v: any) { ->badRhs : (v: any) => void ->v : any - - const a = #field in (v as unknown); // Bad - RHS of in must be object type or any ->a : boolean ->#field in (v as unknown) : boolean ->#field : any ->(v as unknown) : unknown ->v as unknown : unknown ->v : any - - const b = #fiel in v; // Bad - typo in privateID ->b : boolean ->#fiel in v : boolean ->#fiel : any ->v : any - - const c = (#field) in v; // Bad - privateID is not an expression on its own ->c : boolean ->(#field) in v : boolean ->(#field) : any ->v : any - - for (#field in v) { /**/ } // Bad - 'in' not allowed ->v : any - - for (let d in #field in v) { /**/ } // Bad - rhs of in should be a object/any ->d : string ->#field in v : boolean ->#field : any ->v : any - } - whitespace(v: any) { ->whitespace : (v: any) => void ->v : any - - const a = v && /*0*/#field/*1*/ ->a : any ->v && /*0*/#field/*1*/ /*2*/in/*3*/ /*4*/v : any ->v : any ->#field/*1*/ /*2*/in/*3*/ /*4*/v : boolean ->#field : any - - /*2*/in/*3*/ - /*4*/v/*5*/ ->v : any - } - flow(u: unknown, n: never, fb: Foo | Bar, fs: FooSub, b: Bar, fsb: FooSub | Bar, fsfb: Foo | FooSub | Bar) { ->flow : (u: unknown, n: never, fb: Foo | Bar, fs: FooSub, b: Bar, fsb: FooSub | Bar, fsfb: Foo | FooSub | Bar) => void ->u : unknown ->n : never ->fb : Foo | Bar ->fs : FooSub ->b : Bar ->fsb : Bar | FooSub ->fsfb : Foo | Bar | FooSub - - if (typeof u === 'object') { ->typeof u === 'object' : boolean ->typeof u : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" ->u : unknown ->'object' : "object" - - if (#field in n) { ->#field in n : boolean ->#field : any ->n : never - - n; // good n is never ->n : never - } - - if (#field in u) { ->#field in u : boolean ->#field : any ->u : object | null - - u; // good u is Foo ->u : Foo - - } else { - u; // good u is object | null ->u : object | null - } - - if (u !== null) { ->u !== null : boolean ->u : object | null ->null : null - - if (#field in u) { ->#field in u : boolean ->#field : any ->u : object - - u; // good u is Foo ->u : Foo - - } else { - u; // good u is object ->u : object - } - - if (#method in u) { ->#method in u : boolean ->#method : any ->u : object - - u; // good u is Foo ->u : Foo - } - - if (#staticField in u) { ->#staticField in u : boolean ->#staticField : any ->u : object - - u; // good u is typeof Foo ->u : typeof Foo - } - - if (#staticMethod in u) { ->#staticMethod in u : boolean ->#staticMethod : any ->u : object - - u; // good u is typeof Foo ->u : typeof Foo - } - } - } - - if (#field in fb) { ->#field in fb : boolean ->#field : any ->fb : Foo | Bar - - fb; // good fb is Foo ->fb : Foo - - } else { - fb; // good fb is Bar ->fb : Bar - } - - if (#field in fs) { ->#field in fs : boolean ->#field : any ->fs : FooSub - - fs; // good fs is FooSub ->fs : FooSub - - } else { - fs; // good fs is never ->fs : never - } - - if (#field in b) { ->#field in b : boolean ->#field : any ->b : Bar - - b; // good b is 'Bar & Foo' ->b : Bar & Foo - - } else { - b; // good b is Bar ->b : Bar - } - - if (#field in fsb) { ->#field in fsb : boolean ->#field : any ->fsb : Bar | FooSub - - fsb; // good fsb is FooSub ->fsb : FooSub - - } else { - fsb; // good fsb is Bar ->fsb : Bar - } - - if (#field in fsfb) { ->#field in fsfb : boolean ->#field : any ->fsfb : Foo | Bar | FooSub - - fsfb; // good fsfb is 'Foo | FooSub' ->fsfb : Foo | FooSub - - } else { - fsfb; // good fsfb is Bar ->fsfb : Bar - } - - class Nested { ->Nested : Nested - - m(v: any) { ->m : (v: any) => void ->v : any - - if (#field in v) { ->#field in v : boolean ->#field : any ->v : any - - v; // good v is Foo ->v : Foo - } - } - } - } -} - -class FooSub extends Foo { subTypeOfFoo = true } ->FooSub : FooSub ->Foo : Foo ->subTypeOfFoo : boolean ->true : true - -class Bar { notFoo = true } ->Bar : Bar ->notFoo : boolean ->true : true - -function badSyntax(v: Foo) { ->badSyntax : (v: Foo) => boolean ->v : Foo - - return #field in v; // Bad - outside of class ->#field in v : boolean ->#field : any ->v : Foo -} - diff --git a/tests/baselines/reference/privateNameInInExpressionUnused.errors.txt b/tests/baselines/reference/privateNameInInExpressionUnused.errors.txt deleted file mode 100644 index 94d56876d297b..0000000000000 --- a/tests/baselines/reference/privateNameInInExpressionUnused.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -tests/cases/conformance/classes/members/privateNames/privateNameInInExpressionUnused.ts(2,5): error TS6133: '#unused' is declared but its value is never read. - - -==== tests/cases/conformance/classes/members/privateNames/privateNameInInExpressionUnused.ts (1 errors) ==== - class Foo { - #unused: undefined; // expect unused error - ~~~~~~~ -!!! error TS6133: '#unused' is declared but its value is never read. - #brand: undefined; // expect no error - - isFoo(v: any): v is Foo { - // This should count as using/reading '#brand' - return #brand in v; - } - } - \ No newline at end of file diff --git a/tests/baselines/reference/privateNameInInExpressionUnused.js b/tests/baselines/reference/privateNameInInExpressionUnused.js deleted file mode 100644 index 651f2932d1669..0000000000000 --- a/tests/baselines/reference/privateNameInInExpressionUnused.js +++ /dev/null @@ -1,22 +0,0 @@ -//// [privateNameInInExpressionUnused.ts] -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; - } -} - - -//// [privateNameInInExpressionUnused.js] -"use strict"; -class Foo { - #unused; // expect unused error - #brand; // expect no error - isFoo(v) { - // This should count as using/reading '#brand' - return #brand in v; - } -} diff --git a/tests/baselines/reference/privateNameInInExpressionUnused.symbols b/tests/baselines/reference/privateNameInInExpressionUnused.symbols deleted file mode 100644 index 027c62bc16385..0000000000000 --- a/tests/baselines/reference/privateNameInInExpressionUnused.symbols +++ /dev/null @@ -1,23 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameInInExpressionUnused.ts === -class Foo { ->Foo : Symbol(Foo, Decl(privateNameInInExpressionUnused.ts, 0, 0)) - - #unused: undefined; // expect unused error ->#unused : Symbol(Foo.#unused, Decl(privateNameInInExpressionUnused.ts, 0, 11)) - - #brand: undefined; // expect no error ->#brand : Symbol(Foo.#brand, Decl(privateNameInInExpressionUnused.ts, 1, 23)) - - isFoo(v: any): v is Foo { ->isFoo : Symbol(Foo.isFoo, Decl(privateNameInInExpressionUnused.ts, 2, 22)) ->v : Symbol(v, Decl(privateNameInInExpressionUnused.ts, 4, 10)) ->v : Symbol(v, Decl(privateNameInInExpressionUnused.ts, 4, 10)) ->Foo : Symbol(Foo, Decl(privateNameInInExpressionUnused.ts, 0, 0)) - - // This should count as using/reading '#brand' - return #brand in v; ->#brand : Symbol(Foo.#brand, Decl(privateNameInInExpressionUnused.ts, 1, 23)) ->v : Symbol(v, Decl(privateNameInInExpressionUnused.ts, 4, 10)) - } -} - diff --git a/tests/baselines/reference/privateNameInInExpressionUnused.types b/tests/baselines/reference/privateNameInInExpressionUnused.types deleted file mode 100644 index 95d8c12e0530d..0000000000000 --- a/tests/baselines/reference/privateNameInInExpressionUnused.types +++ /dev/null @@ -1,22 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameInInExpressionUnused.ts === -class Foo { ->Foo : Foo - - #unused: undefined; // expect unused error ->#unused : undefined - - #brand: undefined; // expect no error ->#brand : undefined - - isFoo(v: any): v is Foo { ->isFoo : (v: any) => v is Foo ->v : any - - // This should count as using/reading '#brand' - return #brand in v; ->#brand in v : boolean ->#brand : any ->v : any - } -} - diff --git a/tests/baselines/reference/privateNameStaticsAndStaticMethods.js b/tests/baselines/reference/privateNameStaticsAndStaticMethods.js deleted file mode 100644 index a2f814b593467..0000000000000 --- a/tests/baselines/reference/privateNameStaticsAndStaticMethods.js +++ /dev/null @@ -1,62 +0,0 @@ -//// [privateNameStaticsAndStaticMethods.ts] -class A { - static #foo(a: number) {} - static async #bar(a: number) {} - static async *#baz(a: number) { - return 3; - } - static #_quux: number; - static get #quux (): number { - return this.#_quux; - } - static set #quux (val: number) { - this.#_quux = val; - } - constructor () { - A.#foo(30); - A.#bar(30); - A.#bar(30); - A.#quux = A.#quux + 1; - A.#quux++; - } -} - -class B extends A { - static #foo(a: string) {} - constructor () { - super(); - B.#foo("str"); - } -} - - -//// [privateNameStaticsAndStaticMethods.js] -"use strict"; -class A { - constructor() { - A.#foo(30); - A.#bar(30); - A.#bar(30); - A.#quux = A.#quux + 1; - A.#quux++; - } - static #foo(a) { } - static async #bar(a) { } - static async *#baz(a) { - return 3; - } - static #_quux; - static get #quux() { - return this.#_quux; - } - static set #quux(val) { - this.#_quux = val; - } -} -class B extends A { - static #foo(a) { } - constructor() { - super(); - B.#foo("str"); - } -} diff --git a/tests/baselines/reference/privateNameStaticsAndStaticMethods.symbols b/tests/baselines/reference/privateNameStaticsAndStaticMethods.symbols deleted file mode 100644 index b12f3fa4c464d..0000000000000 --- a/tests/baselines/reference/privateNameStaticsAndStaticMethods.symbols +++ /dev/null @@ -1,80 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameStaticsAndStaticMethods.ts === -class A { ->A : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - - static #foo(a: number) {} ->#foo : Symbol(A.#foo, Decl(privateNameStaticsAndStaticMethods.ts, 0, 9)) ->a : Symbol(a, Decl(privateNameStaticsAndStaticMethods.ts, 1, 16)) - - static async #bar(a: number) {} ->#bar : Symbol(A.#bar, Decl(privateNameStaticsAndStaticMethods.ts, 1, 29)) ->a : Symbol(a, Decl(privateNameStaticsAndStaticMethods.ts, 2, 22)) - - static async *#baz(a: number) { ->#baz : Symbol(A.#baz, Decl(privateNameStaticsAndStaticMethods.ts, 2, 35)) ->a : Symbol(a, Decl(privateNameStaticsAndStaticMethods.ts, 3, 23)) - - return 3; - } - static #_quux: number; ->#_quux : Symbol(A.#_quux, Decl(privateNameStaticsAndStaticMethods.ts, 5, 5)) - - static get #quux (): number { ->#quux : Symbol(A.#quux, Decl(privateNameStaticsAndStaticMethods.ts, 6, 26), Decl(privateNameStaticsAndStaticMethods.ts, 9, 5)) - - return this.#_quux; ->this.#_quux : Symbol(A.#_quux, Decl(privateNameStaticsAndStaticMethods.ts, 5, 5)) ->this : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - } - static set #quux (val: number) { ->#quux : Symbol(A.#quux, Decl(privateNameStaticsAndStaticMethods.ts, 6, 26), Decl(privateNameStaticsAndStaticMethods.ts, 9, 5)) ->val : Symbol(val, Decl(privateNameStaticsAndStaticMethods.ts, 10, 22)) - - this.#_quux = val; ->this.#_quux : Symbol(A.#_quux, Decl(privateNameStaticsAndStaticMethods.ts, 5, 5)) ->this : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) ->val : Symbol(val, Decl(privateNameStaticsAndStaticMethods.ts, 10, 22)) - } - constructor () { - A.#foo(30); ->A.#foo : Symbol(A.#foo, Decl(privateNameStaticsAndStaticMethods.ts, 0, 9)) ->A : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - - A.#bar(30); ->A.#bar : Symbol(A.#bar, Decl(privateNameStaticsAndStaticMethods.ts, 1, 29)) ->A : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - - A.#bar(30); ->A.#bar : Symbol(A.#bar, Decl(privateNameStaticsAndStaticMethods.ts, 1, 29)) ->A : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - - A.#quux = A.#quux + 1; ->A.#quux : Symbol(A.#quux, Decl(privateNameStaticsAndStaticMethods.ts, 6, 26), Decl(privateNameStaticsAndStaticMethods.ts, 9, 5)) ->A : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) ->A.#quux : Symbol(A.#quux, Decl(privateNameStaticsAndStaticMethods.ts, 6, 26), Decl(privateNameStaticsAndStaticMethods.ts, 9, 5)) ->A : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - - A.#quux++; ->A.#quux : Symbol(A.#quux, Decl(privateNameStaticsAndStaticMethods.ts, 6, 26), Decl(privateNameStaticsAndStaticMethods.ts, 9, 5)) ->A : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - } -} - -class B extends A { ->B : Symbol(B, Decl(privateNameStaticsAndStaticMethods.ts, 20, 1)) ->A : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - - static #foo(a: string) {} ->#foo : Symbol(B.#foo, Decl(privateNameStaticsAndStaticMethods.ts, 22, 19)) ->a : Symbol(a, Decl(privateNameStaticsAndStaticMethods.ts, 23, 16)) - - constructor () { - super(); ->super : Symbol(A, Decl(privateNameStaticsAndStaticMethods.ts, 0, 0)) - - B.#foo("str"); ->B.#foo : Symbol(B.#foo, Decl(privateNameStaticsAndStaticMethods.ts, 22, 19)) ->B : Symbol(B, Decl(privateNameStaticsAndStaticMethods.ts, 20, 1)) - } -} - diff --git a/tests/baselines/reference/privateNameStaticsAndStaticMethods.types b/tests/baselines/reference/privateNameStaticsAndStaticMethods.types deleted file mode 100644 index c9e37e68f5134..0000000000000 --- a/tests/baselines/reference/privateNameStaticsAndStaticMethods.types +++ /dev/null @@ -1,95 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNameStaticsAndStaticMethods.ts === -class A { ->A : A - - static #foo(a: number) {} ->#foo : (a: number) => void ->a : number - - static async #bar(a: number) {} ->#bar : (a: number) => Promise ->a : number - - static async *#baz(a: number) { ->#baz : (a: number) => AsyncGenerator ->a : number - - return 3; ->3 : 3 - } - static #_quux: number; ->#_quux : number - - static get #quux (): number { ->#quux : number - - return this.#_quux; ->this.#_quux : number ->this : typeof A - } - static set #quux (val: number) { ->#quux : number ->val : number - - this.#_quux = val; ->this.#_quux = val : number ->this.#_quux : number ->this : typeof A ->val : number - } - constructor () { - A.#foo(30); ->A.#foo(30) : void ->A.#foo : (a: number) => void ->A : typeof A ->30 : 30 - - A.#bar(30); ->A.#bar(30) : Promise ->A.#bar : (a: number) => Promise ->A : typeof A ->30 : 30 - - A.#bar(30); ->A.#bar(30) : Promise ->A.#bar : (a: number) => Promise ->A : typeof A ->30 : 30 - - A.#quux = A.#quux + 1; ->A.#quux = A.#quux + 1 : number ->A.#quux : number ->A : typeof A ->A.#quux + 1 : number ->A.#quux : number ->A : typeof A ->1 : 1 - - A.#quux++; ->A.#quux++ : number ->A.#quux : number ->A : typeof A - } -} - -class B extends A { ->B : B ->A : A - - static #foo(a: string) {} ->#foo : (a: string) => void ->a : string - - constructor () { - super(); ->super() : void ->super : typeof A - - B.#foo("str"); ->B.#foo("str") : void ->B.#foo : (a: string) => void ->B : typeof B ->"str" : "str" - } -} - diff --git a/tests/baselines/reference/privateNamesAndMethods.js b/tests/baselines/reference/privateNamesAndMethods.js deleted file mode 100644 index c216ce98e5cb3..0000000000000 --- a/tests/baselines/reference/privateNamesAndMethods.js +++ /dev/null @@ -1,61 +0,0 @@ -//// [privateNamesAndMethods.ts] -class A { - #foo(a: number) {} - async #bar(a: number) {} - async *#baz(a: number) { - return 3; - } - #_quux: number; - get #quux (): number { - return this.#_quux; - } - set #quux (val: number) { - this.#_quux = val; - } - constructor () { - this.#foo(30); - this.#bar(30); - this.#baz(30); - this.#quux = this.#quux + 1; - this.#quux++; - } -} - -class B extends A { - #foo(a: string) {} - constructor () { - super(); - this.#foo("str"); - } -} - - -//// [privateNamesAndMethods.js] -class A { - constructor() { - this.#foo(30); - this.#bar(30); - this.#baz(30); - this.#quux = this.#quux + 1; - this.#quux++; - } - #foo(a) { } - async #bar(a) { } - async *#baz(a) { - return 3; - } - #_quux; - get #quux() { - return this.#_quux; - } - set #quux(val) { - this.#_quux = val; - } -} -class B extends A { - #foo(a) { } - constructor() { - super(); - this.#foo("str"); - } -} diff --git a/tests/baselines/reference/privateNamesAndMethods.symbols b/tests/baselines/reference/privateNamesAndMethods.symbols deleted file mode 100644 index 868a08790c591..0000000000000 --- a/tests/baselines/reference/privateNamesAndMethods.symbols +++ /dev/null @@ -1,80 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNamesAndMethods.ts === -class A { ->A : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - - #foo(a: number) {} ->#foo : Symbol(A.#foo, Decl(privateNamesAndMethods.ts, 0, 9)) ->a : Symbol(a, Decl(privateNamesAndMethods.ts, 1, 9)) - - async #bar(a: number) {} ->#bar : Symbol(A.#bar, Decl(privateNamesAndMethods.ts, 1, 22)) ->a : Symbol(a, Decl(privateNamesAndMethods.ts, 2, 15)) - - async *#baz(a: number) { ->#baz : Symbol(A.#baz, Decl(privateNamesAndMethods.ts, 2, 28)) ->a : Symbol(a, Decl(privateNamesAndMethods.ts, 3, 16)) - - return 3; - } - #_quux: number; ->#_quux : Symbol(A.#_quux, Decl(privateNamesAndMethods.ts, 5, 5)) - - get #quux (): number { ->#quux : Symbol(A.#quux, Decl(privateNamesAndMethods.ts, 6, 19), Decl(privateNamesAndMethods.ts, 9, 5)) - - return this.#_quux; ->this.#_quux : Symbol(A.#_quux, Decl(privateNamesAndMethods.ts, 5, 5)) ->this : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - } - set #quux (val: number) { ->#quux : Symbol(A.#quux, Decl(privateNamesAndMethods.ts, 6, 19), Decl(privateNamesAndMethods.ts, 9, 5)) ->val : Symbol(val, Decl(privateNamesAndMethods.ts, 10, 15)) - - this.#_quux = val; ->this.#_quux : Symbol(A.#_quux, Decl(privateNamesAndMethods.ts, 5, 5)) ->this : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) ->val : Symbol(val, Decl(privateNamesAndMethods.ts, 10, 15)) - } - constructor () { - this.#foo(30); ->this.#foo : Symbol(A.#foo, Decl(privateNamesAndMethods.ts, 0, 9)) ->this : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - - this.#bar(30); ->this.#bar : Symbol(A.#bar, Decl(privateNamesAndMethods.ts, 1, 22)) ->this : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - - this.#baz(30); ->this.#baz : Symbol(A.#baz, Decl(privateNamesAndMethods.ts, 2, 28)) ->this : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - - this.#quux = this.#quux + 1; ->this.#quux : Symbol(A.#quux, Decl(privateNamesAndMethods.ts, 6, 19), Decl(privateNamesAndMethods.ts, 9, 5)) ->this : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) ->this.#quux : Symbol(A.#quux, Decl(privateNamesAndMethods.ts, 6, 19), Decl(privateNamesAndMethods.ts, 9, 5)) ->this : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - - this.#quux++; ->this.#quux : Symbol(A.#quux, Decl(privateNamesAndMethods.ts, 6, 19), Decl(privateNamesAndMethods.ts, 9, 5)) ->this : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - } -} - -class B extends A { ->B : Symbol(B, Decl(privateNamesAndMethods.ts, 20, 1)) ->A : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - - #foo(a: string) {} ->#foo : Symbol(B.#foo, Decl(privateNamesAndMethods.ts, 22, 19)) ->a : Symbol(a, Decl(privateNamesAndMethods.ts, 23, 9)) - - constructor () { - super(); ->super : Symbol(A, Decl(privateNamesAndMethods.ts, 0, 0)) - - this.#foo("str"); ->this.#foo : Symbol(B.#foo, Decl(privateNamesAndMethods.ts, 22, 19)) ->this : Symbol(B, Decl(privateNamesAndMethods.ts, 20, 1)) - } -} - diff --git a/tests/baselines/reference/privateNamesAndMethods.types b/tests/baselines/reference/privateNamesAndMethods.types deleted file mode 100644 index 2d9a1d9363422..0000000000000 --- a/tests/baselines/reference/privateNamesAndMethods.types +++ /dev/null @@ -1,95 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNamesAndMethods.ts === -class A { ->A : A - - #foo(a: number) {} ->#foo : (a: number) => void ->a : number - - async #bar(a: number) {} ->#bar : (a: number) => Promise ->a : number - - async *#baz(a: number) { ->#baz : (a: number) => AsyncGenerator ->a : number - - return 3; ->3 : 3 - } - #_quux: number; ->#_quux : number - - get #quux (): number { ->#quux : number - - return this.#_quux; ->this.#_quux : number ->this : this - } - set #quux (val: number) { ->#quux : number ->val : number - - this.#_quux = val; ->this.#_quux = val : number ->this.#_quux : number ->this : this ->val : number - } - constructor () { - this.#foo(30); ->this.#foo(30) : void ->this.#foo : (a: number) => void ->this : this ->30 : 30 - - this.#bar(30); ->this.#bar(30) : Promise ->this.#bar : (a: number) => Promise ->this : this ->30 : 30 - - this.#baz(30); ->this.#baz(30) : AsyncGenerator ->this.#baz : (a: number) => AsyncGenerator ->this : this ->30 : 30 - - this.#quux = this.#quux + 1; ->this.#quux = this.#quux + 1 : number ->this.#quux : number ->this : this ->this.#quux + 1 : number ->this.#quux : number ->this : this ->1 : 1 - - this.#quux++; ->this.#quux++ : number ->this.#quux : number ->this : this - } -} - -class B extends A { ->B : B ->A : A - - #foo(a: string) {} ->#foo : (a: string) => void ->a : string - - constructor () { - super(); ->super() : void ->super : typeof A - - this.#foo("str"); ->this.#foo("str") : void ->this.#foo : (a: string) => void ->this : this ->"str" : "str" - } -} - diff --git a/tests/baselines/reference/privateNamesAndStaticMethods.js b/tests/baselines/reference/privateNamesAndStaticMethods.js deleted file mode 100644 index f21d0ccd5273d..0000000000000 --- a/tests/baselines/reference/privateNamesAndStaticMethods.js +++ /dev/null @@ -1,62 +0,0 @@ -//// [privateNamesAndStaticMethods.ts] -class A { - static #foo(a: number) {} - static async #bar(a: number) {} - static async *#baz(a: number) { - return 3; - } - static #_quux: number; - static get #quux (): number { - return this.#_quux; - } - static set #quux (val: number) { - this.#_quux = val; - } - constructor () { - A.#foo(30); - A.#bar(30); - A.#bar(30); - A.#quux = A.#quux + 1; - A.#quux++; - } -} - -class B extends A { - static #foo(a: string) {} - constructor () { - super(); - B.#foo("str"); - } -} - - -//// [privateNamesAndStaticMethods.js] -"use strict"; -class A { - constructor() { - A.#foo(30); - A.#bar(30); - A.#bar(30); - A.#quux = A.#quux + 1; - A.#quux++; - } - static #foo(a) { } - static async #bar(a) { } - static async *#baz(a) { - return 3; - } - static #_quux; - static get #quux() { - return this.#_quux; - } - static set #quux(val) { - this.#_quux = val; - } -} -class B extends A { - static #foo(a) { } - constructor() { - super(); - B.#foo("str"); - } -} diff --git a/tests/baselines/reference/privateNamesAndStaticMethods.symbols b/tests/baselines/reference/privateNamesAndStaticMethods.symbols deleted file mode 100644 index 57d684a70696d..0000000000000 --- a/tests/baselines/reference/privateNamesAndStaticMethods.symbols +++ /dev/null @@ -1,80 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNamesAndStaticMethods.ts === -class A { ->A : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - - static #foo(a: number) {} ->#foo : Symbol(A.#foo, Decl(privateNamesAndStaticMethods.ts, 0, 9)) ->a : Symbol(a, Decl(privateNamesAndStaticMethods.ts, 1, 16)) - - static async #bar(a: number) {} ->#bar : Symbol(A.#bar, Decl(privateNamesAndStaticMethods.ts, 1, 29)) ->a : Symbol(a, Decl(privateNamesAndStaticMethods.ts, 2, 22)) - - static async *#baz(a: number) { ->#baz : Symbol(A.#baz, Decl(privateNamesAndStaticMethods.ts, 2, 35)) ->a : Symbol(a, Decl(privateNamesAndStaticMethods.ts, 3, 23)) - - return 3; - } - static #_quux: number; ->#_quux : Symbol(A.#_quux, Decl(privateNamesAndStaticMethods.ts, 5, 5)) - - static get #quux (): number { ->#quux : Symbol(A.#quux, Decl(privateNamesAndStaticMethods.ts, 6, 26), Decl(privateNamesAndStaticMethods.ts, 9, 5)) - - return this.#_quux; ->this.#_quux : Symbol(A.#_quux, Decl(privateNamesAndStaticMethods.ts, 5, 5)) ->this : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - } - static set #quux (val: number) { ->#quux : Symbol(A.#quux, Decl(privateNamesAndStaticMethods.ts, 6, 26), Decl(privateNamesAndStaticMethods.ts, 9, 5)) ->val : Symbol(val, Decl(privateNamesAndStaticMethods.ts, 10, 22)) - - this.#_quux = val; ->this.#_quux : Symbol(A.#_quux, Decl(privateNamesAndStaticMethods.ts, 5, 5)) ->this : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) ->val : Symbol(val, Decl(privateNamesAndStaticMethods.ts, 10, 22)) - } - constructor () { - A.#foo(30); ->A.#foo : Symbol(A.#foo, Decl(privateNamesAndStaticMethods.ts, 0, 9)) ->A : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - - A.#bar(30); ->A.#bar : Symbol(A.#bar, Decl(privateNamesAndStaticMethods.ts, 1, 29)) ->A : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - - A.#bar(30); ->A.#bar : Symbol(A.#bar, Decl(privateNamesAndStaticMethods.ts, 1, 29)) ->A : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - - A.#quux = A.#quux + 1; ->A.#quux : Symbol(A.#quux, Decl(privateNamesAndStaticMethods.ts, 6, 26), Decl(privateNamesAndStaticMethods.ts, 9, 5)) ->A : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) ->A.#quux : Symbol(A.#quux, Decl(privateNamesAndStaticMethods.ts, 6, 26), Decl(privateNamesAndStaticMethods.ts, 9, 5)) ->A : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - - A.#quux++; ->A.#quux : Symbol(A.#quux, Decl(privateNamesAndStaticMethods.ts, 6, 26), Decl(privateNamesAndStaticMethods.ts, 9, 5)) ->A : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - } -} - -class B extends A { ->B : Symbol(B, Decl(privateNamesAndStaticMethods.ts, 20, 1)) ->A : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - - static #foo(a: string) {} ->#foo : Symbol(B.#foo, Decl(privateNamesAndStaticMethods.ts, 22, 19)) ->a : Symbol(a, Decl(privateNamesAndStaticMethods.ts, 23, 16)) - - constructor () { - super(); ->super : Symbol(A, Decl(privateNamesAndStaticMethods.ts, 0, 0)) - - B.#foo("str"); ->B.#foo : Symbol(B.#foo, Decl(privateNamesAndStaticMethods.ts, 22, 19)) ->B : Symbol(B, Decl(privateNamesAndStaticMethods.ts, 20, 1)) - } -} - diff --git a/tests/baselines/reference/privateNamesAndStaticMethods.types b/tests/baselines/reference/privateNamesAndStaticMethods.types deleted file mode 100644 index 706d630f5f9fb..0000000000000 --- a/tests/baselines/reference/privateNamesAndStaticMethods.types +++ /dev/null @@ -1,95 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNamesAndStaticMethods.ts === -class A { ->A : A - - static #foo(a: number) {} ->#foo : (a: number) => void ->a : number - - static async #bar(a: number) {} ->#bar : (a: number) => Promise ->a : number - - static async *#baz(a: number) { ->#baz : (a: number) => AsyncGenerator ->a : number - - return 3; ->3 : 3 - } - static #_quux: number; ->#_quux : number - - static get #quux (): number { ->#quux : number - - return this.#_quux; ->this.#_quux : number ->this : typeof A - } - static set #quux (val: number) { ->#quux : number ->val : number - - this.#_quux = val; ->this.#_quux = val : number ->this.#_quux : number ->this : typeof A ->val : number - } - constructor () { - A.#foo(30); ->A.#foo(30) : void ->A.#foo : (a: number) => void ->A : typeof A ->30 : 30 - - A.#bar(30); ->A.#bar(30) : Promise ->A.#bar : (a: number) => Promise ->A : typeof A ->30 : 30 - - A.#bar(30); ->A.#bar(30) : Promise ->A.#bar : (a: number) => Promise ->A : typeof A ->30 : 30 - - A.#quux = A.#quux + 1; ->A.#quux = A.#quux + 1 : number ->A.#quux : number ->A : typeof A ->A.#quux + 1 : number ->A.#quux : number ->A : typeof A ->1 : 1 - - A.#quux++; ->A.#quux++ : number ->A.#quux : number ->A : typeof A - } -} - -class B extends A { ->B : B ->A : A - - static #foo(a: string) {} ->#foo : (a: string) => void ->a : string - - constructor () { - super(); ->super() : void ->super : typeof A - - B.#foo("str"); ->B.#foo("str") : void ->B.#foo : (a: string) => void ->B : typeof B ->"str" : "str" - } -} - diff --git a/tests/baselines/reference/privateNamesAssertion.js b/tests/baselines/reference/privateNamesAssertion.js deleted file mode 100644 index b6be4d5d4adf2..0000000000000 --- a/tests/baselines/reference/privateNamesAssertion.js +++ /dev/null @@ -1,53 +0,0 @@ -//// [privateNamesAssertion.ts] -class Foo { - #p1: (v: any) => asserts v is string = (v) => { - if (typeof v !== "string") { - throw new Error(); - } - } - m1(v: unknown) { - this.#p1(v); - v; - } -} - -class Foo2 { - #p1(v: any): asserts v is string { - if (typeof v !== "string") { - throw new Error(); - } - } - m1(v: unknown) { - this.#p1(v); - v; - } -} - - -//// [privateNamesAssertion.js] -"use strict"; -class Foo { - constructor() { - this.#p1 = (v) => { - if (typeof v !== "string") { - throw new Error(); - } - }; - } - #p1; - m1(v) { - this.#p1(v); - v; - } -} -class Foo2 { - #p1(v) { - if (typeof v !== "string") { - throw new Error(); - } - } - m1(v) { - this.#p1(v); - v; - } -} diff --git a/tests/baselines/reference/privateNamesAssertion.symbols b/tests/baselines/reference/privateNamesAssertion.symbols deleted file mode 100644 index db548487a7875..0000000000000 --- a/tests/baselines/reference/privateNamesAssertion.symbols +++ /dev/null @@ -1,60 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNamesAssertion.ts === -class Foo { ->Foo : Symbol(Foo, Decl(privateNamesAssertion.ts, 0, 0)) - - #p1: (v: any) => asserts v is string = (v) => { ->#p1 : Symbol(Foo.#p1, Decl(privateNamesAssertion.ts, 0, 11)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 1, 10)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 1, 10)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 1, 44)) - - if (typeof v !== "string") { ->v : Symbol(v, Decl(privateNamesAssertion.ts, 1, 44)) - - throw new Error(); ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) - } - } - m1(v: unknown) { ->m1 : Symbol(Foo.m1, Decl(privateNamesAssertion.ts, 5, 5)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 6, 7)) - - this.#p1(v); ->this.#p1 : Symbol(Foo.#p1, Decl(privateNamesAssertion.ts, 0, 11)) ->this : Symbol(Foo, Decl(privateNamesAssertion.ts, 0, 0)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 6, 7)) - - v; ->v : Symbol(v, Decl(privateNamesAssertion.ts, 6, 7)) - } -} - -class Foo2 { ->Foo2 : Symbol(Foo2, Decl(privateNamesAssertion.ts, 10, 1)) - - #p1(v: any): asserts v is string { ->#p1 : Symbol(Foo2.#p1, Decl(privateNamesAssertion.ts, 12, 12)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 13, 8)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 13, 8)) - - if (typeof v !== "string") { ->v : Symbol(v, Decl(privateNamesAssertion.ts, 13, 8)) - - throw new Error(); ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2022.error.d.ts, --, --)) - } - } - m1(v: unknown) { ->m1 : Symbol(Foo2.m1, Decl(privateNamesAssertion.ts, 17, 5)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 18, 7)) - - this.#p1(v); ->this.#p1 : Symbol(Foo2.#p1, Decl(privateNamesAssertion.ts, 12, 12)) ->this : Symbol(Foo2, Decl(privateNamesAssertion.ts, 10, 1)) ->v : Symbol(v, Decl(privateNamesAssertion.ts, 18, 7)) - - v; ->v : Symbol(v, Decl(privateNamesAssertion.ts, 18, 7)) - } -} - diff --git a/tests/baselines/reference/privateNamesAssertion.types b/tests/baselines/reference/privateNamesAssertion.types deleted file mode 100644 index 44a052728e9eb..0000000000000 --- a/tests/baselines/reference/privateNamesAssertion.types +++ /dev/null @@ -1,69 +0,0 @@ -=== tests/cases/conformance/classes/members/privateNames/privateNamesAssertion.ts === -class Foo { ->Foo : Foo - - #p1: (v: any) => asserts v is string = (v) => { ->#p1 : (v: any) => asserts v is string ->v : any ->(v) => { if (typeof v !== "string") { throw new Error(); } } : (v: any) => void ->v : any - - if (typeof v !== "string") { ->typeof v !== "string" : boolean ->typeof v : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" ->v : any ->"string" : "string" - - throw new Error(); ->new Error() : Error ->Error : ErrorConstructor - } - } - m1(v: unknown) { ->m1 : (v: unknown) => void ->v : unknown - - this.#p1(v); ->this.#p1(v) : void ->this.#p1 : (v: any) => asserts v is string ->this : this ->v : unknown - - v; ->v : string - } -} - -class Foo2 { ->Foo2 : Foo2 - - #p1(v: any): asserts v is string { ->#p1 : (v: any) => asserts v is string ->v : any - - if (typeof v !== "string") { ->typeof v !== "string" : boolean ->typeof v : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function" ->v : any ->"string" : "string" - - throw new Error(); ->new Error() : Error ->Error : ErrorConstructor - } - } - m1(v: unknown) { ->m1 : (v: unknown) => void ->v : unknown - - this.#p1(v); ->this.#p1(v) : void ->this.#p1 : (v: any) => asserts v is string ->this : this ->v : unknown - - v; ->v : string - } -} -