|
|
|
@ -26,17 +26,64 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(26,5): error TS2
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T' is not assignable to type 'U'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(26,12): error TS2536: Type 'K' cannot be used to index type 'T'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(30,5): error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(35,5): error TS2322: Type 'T[K] | undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(40,5): error TS2322: Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(41,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(30,5): error TS2322: Type 'Partial<T>[keyof T]' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'Partial<T>[keyof T]' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'T[keyof T] | undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(35,5): error TS2322: Type 'Partial<T>[K]' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'T[K] | undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'Partial<T>[K]' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'T[K] | undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(40,5): error TS2322: Type 'Partial<U>[keyof T]' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'Partial<U>[keyof T]' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'U[keyof T] | undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(41,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'Partial<U>[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'Partial<U>[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
Type 'T[keyof T]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[keyof T]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T' is not assignable to type 'U'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(45,5): error TS2322: Type 'Partial<U>[K]' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'U[K] | undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'Partial<U>[K]' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'U[K] | undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(46,5): error TS2322: Type 'T[K]' is not assignable to type 'Partial<U>[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'Partial<U>[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
Type 'T[K]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
Type 'T[K]' is not assignable to type 'U[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[K]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T' is not assignable to type 'U'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(51,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(56,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'Readonly<U>[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'Readonly<U>[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
@ -44,11 +91,9 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(41,5): error TS2
|
|
|
|
|
Type 'T[keyof T]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T' is not assignable to type 'U'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(45,5): error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(46,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2322: Type 'T[K]' is not assignable to type 'Readonly<U>[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'Readonly<U>[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
Type 'T[K]' is not assignable to type 'U[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
@ -56,21 +101,6 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(46,5): error TS2
|
|
|
|
|
Type 'T[K]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T' is not assignable to type 'U'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(51,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(56,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[keyof T]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T' is not assignable to type 'U'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[K]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
Type 'T' is not assignable to type 'U'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(72,5): error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
|
|
|
|
|
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(78,5): error TS2322: Type 'Partial<Thing>' is not assignable to type 'Partial<T>'.
|
|
|
|
@ -168,57 +198,81 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
|
|
|
|
function f10<T>(x: T, y: Partial<T>, k: keyof T) {
|
|
|
|
|
x[k] = y[k]; // Error
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'Partial<T>[keyof T]' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'Partial<T>[keyof T]' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
y[k] = x[k];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function f11<T, K extends keyof T>(x: T, y: Partial<T>, k: K) {
|
|
|
|
|
x[k] = y[k]; // Error
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2322: Type 'T[K] | undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'Partial<T>[K]' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K] | undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'Partial<T>[K]' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K] | undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
y[k] = x[k];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function f12<T, U extends T>(x: T, y: Partial<U>, k: keyof T) {
|
|
|
|
|
x[k] = y[k]; // Error
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2322: Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'Partial<U>[keyof T]' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'Partial<U>[keyof T]' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'U[keyof T] | undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
y[k] = x[k]; // Error
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'Partial<U>[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'Partial<U>[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function f13<T, U extends T, K extends keyof T>(x: T, y: Partial<U>, k: K) {
|
|
|
|
|
x[k] = y[k]; // Error
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'Partial<U>[K]' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[K]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'Partial<U>[K]' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
!!! error TS2322: Type 'undefined' is not assignable to type 'T[string]'.
|
|
|
|
|
y[k] = x[k]; // Error
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'Partial<U>[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'Partial<U>[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K] | undefined'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function f20<T>(x: T, y: Readonly<T>, k: keyof T) {
|
|
|
|
@ -239,12 +293,15 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
|
|
|
|
x[k] = y[k];
|
|
|
|
|
y[k] = x[k]; // Error
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'Readonly<U>[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'Readonly<U>[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[keyof T]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
|
|
|
|
}
|
|
|
|
@ -253,12 +310,15 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
|
|
|
|
|
x[k] = y[k];
|
|
|
|
|
y[k] = x[k]; // Error
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'Readonly<U>[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'Readonly<U>[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[K]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T[string]' is not assignable to type 'U[string]'.
|
|
|
|
|
!!! error TS2322: Type 'T' is not assignable to type 'U'.
|
|
|
|
|
~~~~
|
|
|
|
|
!!! error TS2542: Index signature in type 'Readonly<U>' only permits reading.
|
|
|
|
|
}
|
|
|
|
|