From 6355df5d95c9c0202635cefffe4650d9167ee43a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 15 Jul 2025 03:53:44 +0000 Subject: [PATCH] Initial exploration and test case creation Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- tests/cases/compiler/thisTypeComparison.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/cases/compiler/thisTypeComparison.ts diff --git a/tests/cases/compiler/thisTypeComparison.ts b/tests/cases/compiler/thisTypeComparison.ts new file mode 100644 index 00000000000..1bbcae9d033 --- /dev/null +++ b/tests/cases/compiler/thisTypeComparison.ts @@ -0,0 +1,17 @@ +// @strict: true + +class AA { + do1() { + const b = dd.getB(); + if (this === b) { + console.log("this === b"); + } + } +} + +class BB extends AA { + getB(): BB { return this; } +} + +let dd = new BB(); +dd.do1(); \ No newline at end of file