Skip to content

Commit b80793d

Browse files
committed
add failing tests
1 parent 7bee693 commit b80793d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/src/es5.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,26 @@ expectType<{ foo: number; bar: string; baz: boolean }>(
437437
expectType<[2, 2, 2]>(a2);
438438
}
439439
expectType<[string, string, string]>(a2.map(() => "foo"));
440+
441+
// https://github.com/uhyo/better-typescript-lib/issues/35
442+
function template(strings: TemplateStringsArray, ...keys: string[]): string {
443+
const mapped = strings.map((v) => v);
444+
expectType<number>(mapped.length);
445+
}
446+
{
447+
class ArrX extends Array<number> {
448+
constructor(nums: number[]) {
449+
super(...nums);
450+
}
451+
452+
sum(): number {
453+
return this.reduce((s, n) => s + n, 0);
454+
}
455+
}
456+
const arrX = new ArrX([2, 3, 4]);
457+
const mapped = arrX.map((v) => String(v));
458+
expectType<number>(mapped.length);
459+
}
440460
}
441461

442462
// ArrayConstructor

0 commit comments

Comments
 (0)