diff --git a/tests/baselines/reference/recurringTypeParamForContainerOfBase01.js b/tests/baselines/reference/recurringTypeParamForContainerOfBase01.js new file mode 100644 index 00000000000..b3ef0cba312 --- /dev/null +++ b/tests/baselines/reference/recurringTypeParamForContainerOfBase01.js @@ -0,0 +1,27 @@ +//// [recurringTypeParamForContainerOfBase01.ts] + +interface BoxOfFoo> { + item: T +} + +interface Foo> { + self: T; +} + +interface Bar> extends Foo { + other: BoxOfFoo; +} + +//// [recurringTypeParamForContainerOfBase01.js] + + +//// [recurringTypeParamForContainerOfBase01.d.ts] +interface BoxOfFoo> { + item: T; +} +interface Foo> { + self: T; +} +interface Bar> extends Foo { + other: BoxOfFoo; +} diff --git a/tests/baselines/reference/recurringTypeParamForContainerOfBase01.symbols b/tests/baselines/reference/recurringTypeParamForContainerOfBase01.symbols new file mode 100644 index 00000000000..f0a5eafeae2 --- /dev/null +++ b/tests/baselines/reference/recurringTypeParamForContainerOfBase01.symbols @@ -0,0 +1,37 @@ +=== tests/cases/conformance/types/typeParameters/recurringTypeParamForContainerOfBase01.ts === + +interface BoxOfFoo> { +>BoxOfFoo : Symbol(BoxOfFoo, Decl(recurringTypeParamForContainerOfBase01.ts, 0, 0)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 1, 19)) +>Foo : Symbol(Foo, Decl(recurringTypeParamForContainerOfBase01.ts, 3, 1)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 1, 19)) + + item: T +>item : Symbol(item, Decl(recurringTypeParamForContainerOfBase01.ts, 1, 38)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 1, 19)) +} + +interface Foo> { +>Foo : Symbol(Foo, Decl(recurringTypeParamForContainerOfBase01.ts, 3, 1)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 5, 14)) +>Foo : Symbol(Foo, Decl(recurringTypeParamForContainerOfBase01.ts, 3, 1)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 5, 14)) + + self: T; +>self : Symbol(self, Decl(recurringTypeParamForContainerOfBase01.ts, 5, 33)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 5, 14)) +} + +interface Bar> extends Foo { +>Bar : Symbol(Bar, Decl(recurringTypeParamForContainerOfBase01.ts, 7, 1)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 9, 14)) +>Bar : Symbol(Bar, Decl(recurringTypeParamForContainerOfBase01.ts, 7, 1)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 9, 14)) +>Foo : Symbol(Foo, Decl(recurringTypeParamForContainerOfBase01.ts, 3, 1)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 9, 14)) + + other: BoxOfFoo; +>other : Symbol(other, Decl(recurringTypeParamForContainerOfBase01.ts, 9, 48)) +>BoxOfFoo : Symbol(BoxOfFoo, Decl(recurringTypeParamForContainerOfBase01.ts, 0, 0)) +>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 9, 14)) +} diff --git a/tests/baselines/reference/recurringTypeParamForContainerOfBase01.types b/tests/baselines/reference/recurringTypeParamForContainerOfBase01.types new file mode 100644 index 00000000000..38b23263f01 --- /dev/null +++ b/tests/baselines/reference/recurringTypeParamForContainerOfBase01.types @@ -0,0 +1,37 @@ +=== tests/cases/conformance/types/typeParameters/recurringTypeParamForContainerOfBase01.ts === + +interface BoxOfFoo> { +>BoxOfFoo : BoxOfFoo +>T : T +>Foo : Foo +>T : T + + item: T +>item : T +>T : T +} + +interface Foo> { +>Foo : Foo +>T : T +>Foo : Foo +>T : T + + self: T; +>self : T +>T : T +} + +interface Bar> extends Foo { +>Bar : Bar +>T : T +>Bar : Bar +>T : T +>Foo : Foo +>T : T + + other: BoxOfFoo; +>other : BoxOfFoo +>BoxOfFoo : BoxOfFoo +>T : T +} diff --git a/tests/baselines/reference/thisTypeInBasePropertyAndDerivedContainerOfBase01.errors.txt b/tests/baselines/reference/thisTypeInBasePropertyAndDerivedContainerOfBase01.errors.txt new file mode 100644 index 00000000000..cde44b8a13a --- /dev/null +++ b/tests/baselines/reference/thisTypeInBasePropertyAndDerivedContainerOfBase01.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/types/thisType/thisTypeInBasePropertyAndDerivedContainerOfBase01.ts(11,21): error TS2344: Type 'this' does not satisfy the constraint 'Foo'. + Type 'Bar' is not assignable to type 'Foo'. + Types of property 'self' are incompatible. + Type 'Bar' is not assignable to type 'this'. + + +==== tests/cases/conformance/types/thisType/thisTypeInBasePropertyAndDerivedContainerOfBase01.ts (1 errors) ==== + + interface BoxOfFoo { + item: T + } + + interface Foo { + self: this; + } + + interface Bar extends Foo { + other: BoxOfFoo; + ~~~~ +!!! error TS2344: Type 'this' does not satisfy the constraint 'Foo'. +!!! error TS2344: Type 'Bar' is not assignable to type 'Foo'. +!!! error TS2344: Types of property 'self' are incompatible. +!!! error TS2344: Type 'Bar' is not assignable to type 'this'. + } \ No newline at end of file diff --git a/tests/baselines/reference/thisTypeInBasePropertyAndDerivedContainerOfBase01.js b/tests/baselines/reference/thisTypeInBasePropertyAndDerivedContainerOfBase01.js new file mode 100644 index 00000000000..51cc5a24bb6 --- /dev/null +++ b/tests/baselines/reference/thisTypeInBasePropertyAndDerivedContainerOfBase01.js @@ -0,0 +1,27 @@ +//// [thisTypeInBasePropertyAndDerivedContainerOfBase01.ts] + +interface BoxOfFoo { + item: T +} + +interface Foo { + self: this; +} + +interface Bar extends Foo { + other: BoxOfFoo; +} + +//// [thisTypeInBasePropertyAndDerivedContainerOfBase01.js] + + +//// [thisTypeInBasePropertyAndDerivedContainerOfBase01.d.ts] +interface BoxOfFoo { + item: T; +} +interface Foo { + self: this; +} +interface Bar extends Foo { + other: BoxOfFoo; +}