Files
scriptc/tests/coverage-fixtures/mixed.ts
T
Chris Tate c27f6f0253 Coverage fixtures keep their loose-equality pins mixed-kind
- mixed.ts and dynamic-mix.ts compare unknown against number so the SC1040 blocker line survives the same-kind == lowering; snapshots re-record
- corpus 2428's example strings drop the brand word; order-parity baseline re-records for the content change
2026-07-23 01:26:57 -05:00

18 lines
557 B
TypeScript

function score(n: number): number {
let total = 0;
for (let i = 0; i < n; i++) {
total += i % 3 === 0 ? 2 : 1;
}
return total;
}
const items = [1, 2, 3];
const handler = (x: number) => x * 2;
const anyone: unknown = score(1);
const flags = anyone == score(2); // mixed-kind loose equality keeps the fence (same-kind == lowers)
const { length: firstItem } = items; // object patterns over arrays keep the fence (patterns and defaults compile)
let label = "score: ";
label += score(10);
console.log(label);
console.log(items.length, handler(2));