Skip to content

Commit

Permalink
Add a test for passing new Map() to a function that expects some ge…
Browse files Browse the repository at this point in the history
…neric map
  • Loading branch information
amitdahan committed Sep 2, 2024
1 parent cc20e81 commit 922f8a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tests/map-constructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ doNotExecute(() => {
type test = [Expect<Equal<typeof map, Map<string, boolean>>>];
});

doNotExecute(() => {
function expectsBooleanMap(map: Map<string, boolean>) {
return map;
}
const map = expectsBooleanMap(new Map());
type test = [Expect<Equal<typeof map, Map<string, boolean>>>];
});

doNotExecute(() => {
const map = new Map([
["foo", 1],
Expand Down

0 comments on commit 922f8a8

Please sign in to comment.