File: mappedTypeUnionConstraintInferences.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (23 lines) | stat: -rw-r--r-- 1,243 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.


!!! error TS5101: Option 'keyofStringsOnly' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error.
==== tests/cases/compiler/mappedTypeUnionConstraintInferences.ts (0 errors) ====
    export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
    export declare type PartialProperties<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
    export function doSomething_Actual<T extends {
        prop: string;
    }>(a: T) {
        const x: { [P in keyof PartialProperties<T, "prop">]: PartialProperties<T, "prop">[P]; } = null as any;
        return x;
    }
    export declare function doSomething_Expected<T extends {
        prop: string;
    }>(a: T): { [P in keyof PartialProperties<T, "prop">]: PartialProperties<T, "prop">[P]; };
    
    export let a = doSomething_Actual({ prop: "test" });
    a = {} // should be fine, equivalent to below
    
    export let b = doSomething_Expected({ prop: "test" });
    b = {} // fine