diff --git a/tests/cases/conformance/types/mapped/mappedTypes1.ts b/tests/cases/conformance/types/mapped/mappedTypes1.ts index d090b731518..b74872c2bfd 100644 --- a/tests/cases/conformance/types/mapped/mappedTypes1.ts +++ b/tests/cases/conformance/types/mapped/mappedTypes1.ts @@ -34,7 +34,9 @@ type T47 = { [P in string | "a" | "b" | "0" | "1"]: void }; declare function f1(): { [P in keyof T1]: void }; declare function f2(): { [P in keyof T1]: void }; declare function f3(): { [P in keyof T1]: void }; +declare function f4(): { [P in keyof T1]: void }; let x1 = f1(); let x2 = f2(); -let x3 = f3(); \ No newline at end of file +let x3 = f3(); +let x4 = f4(); \ No newline at end of file diff --git a/tests/cases/conformance/types/mapped/mappedTypes2.ts b/tests/cases/conformance/types/mapped/mappedTypes2.ts index e72a0c0a892..60db4c1383b 100644 --- a/tests/cases/conformance/types/mapped/mappedTypes2.ts +++ b/tests/cases/conformance/types/mapped/mappedTypes2.ts @@ -31,25 +31,30 @@ declare function pick(obj: T, ...keys: K[]): Pick; declare function mapObject(obj: Record, f: (x: T) => U): Record; declare function proxify(obj: T): Proxify; +interface Point { + x: number; + y: number; +} + interface Shape { name: string; width: number; height: number; - visible: boolean; + location: Point; } interface PartialShape { name?: string; width?: number; height?: number; - visible?: boolean; + location?: Point; } interface ReadonlyShape { readonly name: string; readonly width: number; readonly height: number; - readonly visible: boolean; + readonly location: Point; } function f0(s1: Shape, s2: Shape) { @@ -70,7 +75,7 @@ function f2(shape: Shape) { } function f3(shape: Shape) { - const x = pick(shape, "name", "visible"); // { name: string, visible: boolean } + const x = pick(shape, "name", "location"); // { name: string, location: Point } } function f4() { @@ -81,11 +86,11 @@ function f4() { function f5(shape: Shape) { const p = proxify(shape); let name = p.name.get(); - p.visible.set(false); + p.width.set(42); } function f6(shape: DeepReadonly) { - let name = shape.name; // DeepReadonly - let length = name.length; // DeepReadonly - let toString = length.toString; // DeepReadonly<(radix?: number) => string> + let name = shape.name; // string + let location = shape.location; // DeepReadonly + let x = location.x; // number } \ No newline at end of file