You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
static: an object-literal key named arguments inside an arrow function is read as the arguments object (SC2009) #431
Inside an arrow function, an object-literal property named arguments is treated as a read of the arguments object. The function is then refused as variadic (SC2009). Node's own APIs have this shape: node-redis takes { keys, arguments } in eval/evalSha.
$ node a.ts1
$ scriptc run a.tsa.ts:1:7 - error SC2009: values of type '() => { arguments: number; }' cannot be compiled: the function shape is supported, but its signature is variadic ('arguments'-reading), and a compiled signature is fixed-arity
The same body in a function declaration compiles. So does a property access such as o.arguments.
bodyReadsArguments (frontend/lowering/lower-calls.ts) and its copy bodyReadsArgumentsLocal (frontend/type-mapper.ts) count every Identifier whose text is arguments, except the name of a property access. A property-assignment name in an object literal is also an Identifier, so it counts. So would a property signature in an inline type, a destructuring property name (const { arguments: a } = o) or a method name.
Activity
Treat property names spelled arguments as names, not reads
test: record TypeScript 7 parity for arguments properties
fix: distinguish arguments property names from reads (#475)