mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Accepted baselines.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
//// [recurringTypeParamForContainerOfBase01.ts]
|
||||
|
||||
interface BoxOfFoo<T extends Foo<T>> {
|
||||
item: T
|
||||
}
|
||||
|
||||
interface Foo<T extends Foo<T>> {
|
||||
self: T;
|
||||
}
|
||||
|
||||
interface Bar<T extends Bar<T>> extends Foo<T> {
|
||||
other: BoxOfFoo<T>;
|
||||
}
|
||||
|
||||
//// [recurringTypeParamForContainerOfBase01.js]
|
||||
|
||||
|
||||
//// [recurringTypeParamForContainerOfBase01.d.ts]
|
||||
interface BoxOfFoo<T extends Foo<T>> {
|
||||
item: T;
|
||||
}
|
||||
interface Foo<T extends Foo<T>> {
|
||||
self: T;
|
||||
}
|
||||
interface Bar<T extends Bar<T>> extends Foo<T> {
|
||||
other: BoxOfFoo<T>;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/conformance/types/typeParameters/recurringTypeParamForContainerOfBase01.ts ===
|
||||
|
||||
interface BoxOfFoo<T extends Foo<T>> {
|
||||
>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<T extends Foo<T>> {
|
||||
>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<T extends Bar<T>> extends Foo<T> {
|
||||
>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<T>;
|
||||
>other : Symbol(other, Decl(recurringTypeParamForContainerOfBase01.ts, 9, 48))
|
||||
>BoxOfFoo : Symbol(BoxOfFoo, Decl(recurringTypeParamForContainerOfBase01.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(recurringTypeParamForContainerOfBase01.ts, 9, 14))
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/conformance/types/typeParameters/recurringTypeParamForContainerOfBase01.ts ===
|
||||
|
||||
interface BoxOfFoo<T extends Foo<T>> {
|
||||
>BoxOfFoo : BoxOfFoo<T>
|
||||
>T : T
|
||||
>Foo : Foo<T>
|
||||
>T : T
|
||||
|
||||
item: T
|
||||
>item : T
|
||||
>T : T
|
||||
}
|
||||
|
||||
interface Foo<T extends Foo<T>> {
|
||||
>Foo : Foo<T>
|
||||
>T : T
|
||||
>Foo : Foo<T>
|
||||
>T : T
|
||||
|
||||
self: T;
|
||||
>self : T
|
||||
>T : T
|
||||
}
|
||||
|
||||
interface Bar<T extends Bar<T>> extends Foo<T> {
|
||||
>Bar : Bar<T>
|
||||
>T : T
|
||||
>Bar : Bar<T>
|
||||
>T : T
|
||||
>Foo : Foo<T>
|
||||
>T : T
|
||||
|
||||
other: BoxOfFoo<T>;
|
||||
>other : BoxOfFoo<T>
|
||||
>BoxOfFoo : BoxOfFoo<T>
|
||||
>T : T
|
||||
}
|
||||
@@ -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<T extends Foo> {
|
||||
item: T
|
||||
}
|
||||
|
||||
interface Foo {
|
||||
self: this;
|
||||
}
|
||||
|
||||
interface Bar extends Foo {
|
||||
other: BoxOfFoo<this>;
|
||||
~~~~
|
||||
!!! 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'.
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
//// [thisTypeInBasePropertyAndDerivedContainerOfBase01.ts]
|
||||
|
||||
interface BoxOfFoo<T extends Foo> {
|
||||
item: T
|
||||
}
|
||||
|
||||
interface Foo {
|
||||
self: this;
|
||||
}
|
||||
|
||||
interface Bar extends Foo {
|
||||
other: BoxOfFoo<this>;
|
||||
}
|
||||
|
||||
//// [thisTypeInBasePropertyAndDerivedContainerOfBase01.js]
|
||||
|
||||
|
||||
//// [thisTypeInBasePropertyAndDerivedContainerOfBase01.d.ts]
|
||||
interface BoxOfFoo<T extends Foo> {
|
||||
item: T;
|
||||
}
|
||||
interface Foo {
|
||||
self: this;
|
||||
}
|
||||
interface Bar extends Foo {
|
||||
other: BoxOfFoo<this>;
|
||||
}
|
||||
Reference in New Issue
Block a user