mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
ffb99e2fea
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
293 lines
13 KiB
Plaintext
293 lines
13 KiB
Plaintext
//// [tests/cases/conformance/controlFlow/controlFlowAliasing2.ts] ////
|
|
|
|
=== controlFlowAliasing2.ts ===
|
|
// https://github.com/microsoft/TypeScript/issues/61784
|
|
|
|
type Test = TestA | TestB;
|
|
>Test : Symbol(Test, Decl(controlFlowAliasing2.ts, 0, 0))
|
|
>TestA : Symbol(TestA, Decl(controlFlowAliasing2.ts, 2, 26))
|
|
>TestB : Symbol(TestB, Decl(controlFlowAliasing2.ts, 7, 1))
|
|
|
|
interface TestA {
|
|
>TestA : Symbol(TestA, Decl(controlFlowAliasing2.ts, 2, 26))
|
|
|
|
type: 'a';
|
|
>type : Symbol(TestA.type, Decl(controlFlowAliasing2.ts, 4, 17))
|
|
|
|
name: string;
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
interface TestB {
|
|
>TestB : Symbol(TestB, Decl(controlFlowAliasing2.ts, 7, 1))
|
|
|
|
type: 'b';
|
|
>type : Symbol(TestB.type, Decl(controlFlowAliasing2.ts, 9, 17))
|
|
|
|
value: number;
|
|
>value : Symbol(TestB.value, Decl(controlFlowAliasing2.ts, 10, 12))
|
|
}
|
|
|
|
function _tcb1(this: { test: Test }) {
|
|
>_tcb1 : Symbol(_tcb1, Decl(controlFlowAliasing2.ts, 12, 1))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 14, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>Test : Symbol(Test, Decl(controlFlowAliasing2.ts, 0, 0))
|
|
|
|
// TS generated by Angular's Type Check block
|
|
const _t1 = (((((this).test)).type));
|
|
>_t1 : Symbol(_t1, Decl(controlFlowAliasing2.ts, 16, 7))
|
|
>(((this).test)).type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 14, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
|
|
if (_t1 === "a") {
|
|
>_t1 : Symbol(_t1, Decl(controlFlowAliasing2.ts, 16, 7))
|
|
|
|
(((((this).test)).name));
|
|
>(((this).test)).name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 14, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
// Same as above, without the parenthesis
|
|
const _t2 = this.test.type;
|
|
>_t2 : Symbol(_t2, Decl(controlFlowAliasing2.ts, 22, 7))
|
|
>this.test.type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 14, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
|
|
if (_t2 === "a") {
|
|
>_t2 : Symbol(_t2, Decl(controlFlowAliasing2.ts, 22, 7))
|
|
|
|
(((((this).test)).name));
|
|
>(((this).test)).name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 14, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
// Same as above without parenthesis at both places
|
|
const testType = this.test.type;
|
|
>testType : Symbol(testType, Decl(controlFlowAliasing2.ts, 28, 7))
|
|
>this.test.type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 14, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
|
|
if (testType === "a") {
|
|
>testType : Symbol(testType, Decl(controlFlowAliasing2.ts, 28, 7))
|
|
|
|
this.test.name;
|
|
>this.test.name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 14, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 14, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
}
|
|
|
|
function _tcb2(this: { test: Test }) {
|
|
>_tcb2 : Symbol(_tcb2, Decl(controlFlowAliasing2.ts, 32, 1))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 34, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>Test : Symbol(Test, Decl(controlFlowAliasing2.ts, 0, 0))
|
|
|
|
// TS generated by Angular's Type Check block
|
|
const _t1 = (((((this).test)).type));
|
|
>_t1 : Symbol(_t1, Decl(controlFlowAliasing2.ts, 36, 7))
|
|
>(((this).test)).type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 34, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
|
|
if ("a" === _t1) {
|
|
>_t1 : Symbol(_t1, Decl(controlFlowAliasing2.ts, 36, 7))
|
|
|
|
(((((this).test)).name));
|
|
>(((this).test)).name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 34, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
// Same as above, without the parenthesis
|
|
const _t2 = this.test.type;
|
|
>_t2 : Symbol(_t2, Decl(controlFlowAliasing2.ts, 42, 7))
|
|
>this.test.type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 34, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
|
|
if ("a" === _t2) {
|
|
>_t2 : Symbol(_t2, Decl(controlFlowAliasing2.ts, 42, 7))
|
|
|
|
(((((this).test)).name));
|
|
>(((this).test)).name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 34, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
// Same as above without parenthesis at both places
|
|
const testType = this.test.type;
|
|
>testType : Symbol(testType, Decl(controlFlowAliasing2.ts, 48, 7))
|
|
>this.test.type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 34, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
|
|
if ("a" === testType) {
|
|
>testType : Symbol(testType, Decl(controlFlowAliasing2.ts, 48, 7))
|
|
|
|
this.test.name;
|
|
>this.test.name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 34, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 34, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
}
|
|
|
|
function _tcb3(this: { test: Test }) {
|
|
>_tcb3 : Symbol(_tcb3, Decl(controlFlowAliasing2.ts, 52, 1))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 54, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>Test : Symbol(Test, Decl(controlFlowAliasing2.ts, 0, 0))
|
|
|
|
const { type: _t1 } = (((((this).test))));
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>_t1 : Symbol(_t1, Decl(controlFlowAliasing2.ts, 55, 9))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 54, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
|
|
if (_t1 === "a") {
|
|
>_t1 : Symbol(_t1, Decl(controlFlowAliasing2.ts, 55, 9))
|
|
|
|
(((((this).test)).name));
|
|
>(((this).test)).name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 54, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
// Same as above, without the parenthesis
|
|
const { type: _t2 } = this.test;
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>_t2 : Symbol(_t2, Decl(controlFlowAliasing2.ts, 61, 9))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 54, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
|
|
if (_t2 === "a") {
|
|
>_t2 : Symbol(_t2, Decl(controlFlowAliasing2.ts, 61, 9))
|
|
|
|
(((((this).test)).name));
|
|
>(((this).test)).name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 54, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
// Same as above without parenthesis at both places
|
|
const { type: testType } = this.test;
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>testType : Symbol(testType, Decl(controlFlowAliasing2.ts, 67, 9))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 54, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
|
|
if (testType === "a") {
|
|
>testType : Symbol(testType, Decl(controlFlowAliasing2.ts, 67, 9))
|
|
|
|
this.test.name;
|
|
>this.test.name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 54, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 54, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
}
|
|
|
|
function _tcb4(this: { test: Test }) {
|
|
>_tcb4 : Symbol(_tcb4, Decl(controlFlowAliasing2.ts, 71, 1))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 73, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>Test : Symbol(Test, Decl(controlFlowAliasing2.ts, 0, 0))
|
|
|
|
const { type: _t1 } = (((((this).test))));
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>_t1 : Symbol(_t1, Decl(controlFlowAliasing2.ts, 74, 9))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 73, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
|
|
if ("a" === _t1) {
|
|
>_t1 : Symbol(_t1, Decl(controlFlowAliasing2.ts, 74, 9))
|
|
|
|
(((((this).test)).name));
|
|
>(((this).test)).name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 73, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
// Same as above, without the parenthesis
|
|
const { type: _t2 } = this.test;
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>_t2 : Symbol(_t2, Decl(controlFlowAliasing2.ts, 80, 9))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 73, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
|
|
if ("a" === _t2) {
|
|
>_t2 : Symbol(_t2, Decl(controlFlowAliasing2.ts, 80, 9))
|
|
|
|
(((((this).test)).name));
|
|
>(((this).test)).name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>(this).test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 73, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
|
|
// Same as above without parenthesis at both places
|
|
const { type: testType } = this.test;
|
|
>type : Symbol(type, Decl(controlFlowAliasing2.ts, 4, 17), Decl(controlFlowAliasing2.ts, 9, 17))
|
|
>testType : Symbol(testType, Decl(controlFlowAliasing2.ts, 86, 9))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 73, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
|
|
if ("a" === testType) {
|
|
>testType : Symbol(testType, Decl(controlFlowAliasing2.ts, 86, 9))
|
|
|
|
this.test.name;
|
|
>this.test.name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
>this.test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>this : Symbol(this, Decl(controlFlowAliasing2.ts, 73, 15))
|
|
>test : Symbol(test, Decl(controlFlowAliasing2.ts, 73, 22))
|
|
>name : Symbol(TestA.name, Decl(controlFlowAliasing2.ts, 5, 12))
|
|
}
|
|
}
|
|
|
|
export {};
|
|
|