diff --git a/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.js b/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.js new file mode 100644 index 00000000000..0e4408f69fd --- /dev/null +++ b/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.js @@ -0,0 +1,9 @@ +//// [indexedAccessToThisTypeOnIntersection01.ts] +interface A { + a: string; + getA: this['a']; +} + +type T = (A & { a: number })['getA']; + +//// [indexedAccessToThisTypeOnIntersection01.js] diff --git a/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.symbols b/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.symbols new file mode 100644 index 00000000000..b3af8d0c953 --- /dev/null +++ b/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.symbols @@ -0,0 +1,16 @@ +=== tests/cases/compiler/indexedAccessToThisTypeOnIntersection01.ts === +interface A { +>A : Symbol(A, Decl(indexedAccessToThisTypeOnIntersection01.ts, 0, 0)) + + a: string; +>a : Symbol(A.a, Decl(indexedAccessToThisTypeOnIntersection01.ts, 0, 13)) + + getA: this['a']; +>getA : Symbol(A.getA, Decl(indexedAccessToThisTypeOnIntersection01.ts, 1, 12)) +} + +type T = (A & { a: number })['getA']; +>T : Symbol(T, Decl(indexedAccessToThisTypeOnIntersection01.ts, 3, 1)) +>A : Symbol(A, Decl(indexedAccessToThisTypeOnIntersection01.ts, 0, 0)) +>a : Symbol(a, Decl(indexedAccessToThisTypeOnIntersection01.ts, 5, 15)) + diff --git a/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.types b/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.types new file mode 100644 index 00000000000..60cabd1d77b --- /dev/null +++ b/tests/baselines/reference/indexedAccessToThisTypeOnIntersection01.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/indexedAccessToThisTypeOnIntersection01.ts === +interface A { + a: string; +>a : string + + getA: this['a']; +>getA : this["a"] +} + +type T = (A & { a: number })['getA']; +>T : never +>a : number + diff --git a/tests/cases/compiler/indexedAccessToThisTypeOnIntersection01.ts b/tests/cases/compiler/indexedAccessToThisTypeOnIntersection01.ts new file mode 100644 index 00000000000..63a4a9d37e5 --- /dev/null +++ b/tests/cases/compiler/indexedAccessToThisTypeOnIntersection01.ts @@ -0,0 +1,6 @@ +interface A { + a: string; + getA: this['a']; +} + +type T = (A & { a: number })['getA']; \ No newline at end of file