Skip to content

Atomics.notify doesn't allow omitting last parameter #37127

Closed
@RReverser

Description

@RReverser

TypeScript Version: 3.8.3

Search Terms:

  • Atomics.notify
  • Atomics

Code

let sab = new SharedArrayBuffer(4);
let int = new Int32Array(sab);
Atomics.notify(int, 0);

Expected behavior:
Compiles successfully.

Actual behavior:
Getting an error:

../temp.ts:3:9 - error TS2554: Expected 3 arguments, but got 2.

3 Atomics.notify(int, 0);
          ~~~~~~~~~~~~~~

  ../../../AppData/Roaming/npm/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts:126:51
    126     notify(typedArray: Int32Array, index: number, count: number): number;
                                                          ~~~~~~~~~~~~~
    An argument for 'count' was not provided.


Found 1 error.

Playground Link: Actually, this is probably a separate issue, but playground seems to lack definitions for shared memory primitives, even though CLI does. E.g. check a link for the code above: Playground Link

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions