mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
34 lines
2.2 KiB
Plaintext
34 lines
2.2 KiB
Plaintext
//// [tests/cases/compiler/constraintsThatReferenceOtherContstraints1.ts] ////
|
|
|
|
=== constraintsThatReferenceOtherContstraints1.ts ===
|
|
interface Object { }
|
|
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 0))
|
|
|
|
class Foo<T, U extends T> { }
|
|
>Foo : Symbol(Foo, Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 20))
|
|
>T : Symbol(T, Decl(constraintsThatReferenceOtherContstraints1.ts, 2, 10))
|
|
>U : Symbol(U, Decl(constraintsThatReferenceOtherContstraints1.ts, 2, 12))
|
|
>T : Symbol(T, Decl(constraintsThatReferenceOtherContstraints1.ts, 2, 10))
|
|
|
|
class Bar<T extends Object, U extends T> {
|
|
>Bar : Symbol(Bar, Decl(constraintsThatReferenceOtherContstraints1.ts, 2, 29))
|
|
>T : Symbol(T, Decl(constraintsThatReferenceOtherContstraints1.ts, 3, 10))
|
|
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 0))
|
|
>U : Symbol(U, Decl(constraintsThatReferenceOtherContstraints1.ts, 3, 27))
|
|
>T : Symbol(T, Decl(constraintsThatReferenceOtherContstraints1.ts, 3, 10))
|
|
|
|
data: Foo<Object, Object>; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'.
|
|
>data : Symbol(Bar.data, Decl(constraintsThatReferenceOtherContstraints1.ts, 3, 42))
|
|
>Foo : Symbol(Foo, Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 20))
|
|
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 0))
|
|
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 0))
|
|
}
|
|
|
|
var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type
|
|
>x : Symbol(x, Decl(constraintsThatReferenceOtherContstraints1.ts, 7, 3))
|
|
>Foo : Symbol(Foo, Decl(constraintsThatReferenceOtherContstraints1.ts, 0, 20))
|
|
>a : Symbol(a, Decl(constraintsThatReferenceOtherContstraints1.ts, 7, 13))
|
|
>a : Symbol(a, Decl(constraintsThatReferenceOtherContstraints1.ts, 7, 28))
|
|
>b : Symbol(b, Decl(constraintsThatReferenceOtherContstraints1.ts, 7, 39))
|
|
|