Skip to content

[reanalyze] [bug] panic calls should not result in suggested annotations #7678

@tx46

Description

@tx46

repro:

let foo = () => {
  panic("foo")
}

reanalyze gives:

{
  "name": "Exception Analysis",
  "kind": "warning",
  "file": "Foo.res",
  "range": [20,4,20,7],
  "message": "foo might raise JsExn (Foo.res:22:2) and is not annotated with @raises(JsExn)",
  "annotate": { "line": 20, "character": 0, "text": "@raises(JsExn)\n", "action": "Add @raises annotation"}
}

although technically correct, it's not interesting because you're never supposed to catch it anyway.

either replace the exception thrown by panic to be named Panic and keep the raises annotation suggestion (makes it clear that the path can panic) or have reanalyze exclude panic calls from analysis.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions