tests/cases/conformance/types/mapped/mappedTypeErrors.ts(20,20): error TS2313: Type parameter 'P' has a circular constraint.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(21,20): error TS2322: Type 'Date' is not assignable to type 'string | number'.
  Type 'Date' is not assignable to type 'number'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(22,19): error TS2344: Type 'Date' does not satisfy the constraint 'string | number'.
  Type 'Date' is not assignable to type 'number'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(25,24): error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(26,24): error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
  Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(28,24): error TS2344: Type '"x" | "y"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
  Type '"x"' is not assignable to type '"name" | "width" | "height" | "visible"'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(30,24): error TS2344: Type 'undefined' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(33,24): error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
  Type 'T' is not assignable to type '"visible"'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
  Type 'string | number' is not assignable to type '"name" | "width" | "height" | "visible"'.
    Type 'string' is not assignable to type '"name" | "width" | "height" | "visible"'.
      Type 'T' is not assignable to type '"visible"'.
        Type 'string | number' is not assignable to type '"visible"'.
          Type 'string' is not assignable to type '"visible"'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(59,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]?: T[P]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(60,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]: T[P]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]?: T[P]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'.


==== tests/cases/conformance/types/mapped/mappedTypeErrors.ts (13 errors) ====
    
    interface Shape {
        name: string;
        width: number;
        height: number;
        visible: boolean;
    }
    
    interface Named {
        name: string;
    }
    
    interface Point {
        x: number;
        y: number;
    }
    
    // Constraint checking
    
    type T00 = { [P in P]: string };  // Error
                       ~
!!! error TS2313: Type parameter 'P' has a circular constraint.
    type T01 = { [P in Date]: number };  // Error
                       ~~~~
!!! error TS2322: Type 'Date' is not assignable to type 'string | number'.
!!! error TS2322:   Type 'Date' is not assignable to type 'number'.
    type T02 = Record<Date, number>;  // Error
                      ~~~~
!!! error TS2344: Type 'Date' does not satisfy the constraint 'string | number'.
!!! error TS2344:   Type 'Date' is not assignable to type 'number'.
    
    type T10 = Pick<Shape, "name">;
    type T11 = Pick<Shape, "foo">;  // Error
                           ~~~~~
!!! error TS2344: Type '"foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
    type T12 = Pick<Shape, "name" | "foo">;  // Error
                           ~~~~~~~~~~~~~~
!!! error TS2344: Type '"name" | "foo"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
!!! error TS2344:   Type '"foo"' is not assignable to type '"name" | "width" | "height" | "visible"'.
    type T13 = Pick<Shape, keyof Named>;
    type T14 = Pick<Shape, keyof Point>;  // Error
                           ~~~~~~~~~~~
!!! error TS2344: Type '"x" | "y"' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
!!! error TS2344:   Type '"x"' is not assignable to type '"name" | "width" | "height" | "visible"'.
    type T15 = Pick<Shape, never>;
    type T16 = Pick<Shape, undefined>;  // Error
                           ~~~~~~~~~
!!! error TS2344: Type 'undefined' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
    
    function f1<T>(x: T) {
        let y: Pick<Shape, T>;  // Error
                           ~
!!! error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
!!! error TS2344:   Type 'T' is not assignable to type '"visible"'.
    }
    
    function f2<T extends string | number>(x: T) {
        let y: Pick<Shape, T>;  // Error
                           ~
!!! error TS2344: Type 'T' does not satisfy the constraint '"name" | "width" | "height" | "visible"'.
!!! error TS2344:   Type 'string | number' is not assignable to type '"name" | "width" | "height" | "visible"'.
!!! error TS2344:     Type 'string' is not assignable to type '"name" | "width" | "height" | "visible"'.
!!! error TS2344:       Type 'T' is not assignable to type '"visible"'.
!!! error TS2344:         Type 'string | number' is not assignable to type '"visible"'.
!!! error TS2344:           Type 'string' is not assignable to type '"visible"'.
    }
    
    function f3<T extends keyof Shape>(x: T) {
        let y: Pick<Shape, T>;
    }
    
    function f4<T extends keyof Named>(x: T) {
        let y: Pick<Shape, T>;
    }
    
    // Type identity checking
    
    function f10<T>() {
        type K = keyof T;
        var x: { [P in keyof T]: T[P] };
        var x: { [Q in keyof T]: T[Q] };
        var x: { [R in K]: T[R] };
    }
    
    function f11<T>() {
        var x: { [P in keyof T]: T[P] };
        var x: { [P in keyof T]?: T[P] };  // Error
            ~
!!! error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]?: T[P]; }'.
        var x: { readonly [P in keyof T]: T[P] };  // Error
            ~
!!! error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]: T[P]; }'.
        var x: { readonly [P in keyof T]?: T[P] };  // Error
            ~
!!! error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]?: T[P]; }'.
    }
    
    function f12<T>() {
        var x: { [P in keyof T]: T[P] };
        var x: { [P in keyof T]: T[P][] };  // Error
            ~
!!! error TS2403: Subsequent variable declarations must have the same type.  Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'.
    }