Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Apr 27, 2019
1 parent 0759bc6 commit 4f38aa8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/cases/compiler/substitutionTypesInIndexedAccessTypes.ts
@@ -0,0 +1,20 @@
// @strict: true

// Repro from #31086

type UserArgs = {
select?: boolean
};

type Subset<T, U> = { [key in keyof T]: key extends keyof U ? T[key] : never };

declare function withBoundary<T extends UserArgs>(args?: Subset<T, UserArgs>): T;
declare function withoutBoundary<T extends UserArgs>(args?: T): T;

const boundaryResult = withBoundary({
select: true,
});

const withoutBoundaryResult = withoutBoundary({
select: true,
});

0 comments on commit 4f38aa8

Please sign in to comment.