Skip to content

Arity check %raw #6213

Closed
Closed
@cristianoc

Description

@cristianoc

Check that the JS code is a function of the arity specified by the type annotation.

E.g.: this is fine as the arity of the type matches the arity of JS.

let canUseCanvas: unit => bool = %raw(`
  function canUseCanvas() {
    return !!document.createElement('canvas').getContext;
  }
`)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions