mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
15 lines
756 B
Plaintext
15 lines
756 B
Plaintext
constraintsThatReferenceOtherContstraints1.ts(5,5): error TS2564: Property 'data' has no initializer and is not definitely assigned in the constructor.
|
|
|
|
|
|
==== constraintsThatReferenceOtherContstraints1.ts (1 errors) ====
|
|
interface Object { }
|
|
|
|
class Foo<T, U extends T> { }
|
|
class Bar<T extends Object, U extends T> {
|
|
data: Foo<Object, Object>; // Error 1 Type 'Object' does not satisfy the constraint 'T' for type parameter 'U extends T'.
|
|
~~~~
|
|
!!! error TS2564: Property 'data' has no initializer and is not definitely assigned in the constructor.
|
|
}
|
|
|
|
var x: Foo< { a: string }, { a: string; b: number }>; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type
|
|
|