Skip to content

Commit 1da6bcc

Browse files
committed
Added runtime to 25
1 parent 68db7d4 commit 1da6bcc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/05-function-overloads/25-generics-in-function-overloads.problem.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import { it } from "vitest";
22
import { Equal, Expect } from "../helpers/type-utils";
33

44
function returnWhatIPassInExceptFor1(t: unknown): unknown {
5+
if (t === 1) {
6+
return 2;
7+
}
58
return t;
69
}
710

src/05-function-overloads/25-generics-in-function-overloads.solution.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { Equal, Expect } from "../helpers/type-utils";
44
function returnWhatIPassInExceptFor1(t: 1): 2;
55
function returnWhatIPassInExceptFor1<T>(t: T): T;
66
function returnWhatIPassInExceptFor1(t: unknown): unknown {
7+
if (t === 1) {
8+
return 2;
9+
}
710
return t;
811
}
912

0 commit comments

Comments
 (0)