mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
- 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
18 lines
557 B
TypeScript
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));
|