Skip to content

Recursive function with no parameters generate while loop which contains assignment to undeclared _param variable #6719

Closed
@hackwaly

Description

@hackwaly

Thank you for filing! Check list:

  • Is it a bug? Usage questions should often be asked in the forum instead.
  • Concise, focused, friendly issue title & description.

Recursive function with no parameters generate while loop which contains assignment to undeclared _param variable

let test = () => {
  let rec loop = () => {
    switch () {
    | _ => loop()
    }
  }
  loop()
}
// Generated by ReScript, PLEASE EDIT WITH CARE


function test() {
  var loop = function () {
    while(true) {
      _param = undefined;
      continue ;
    };
  };
  return loop();
}

export {
  test ,
}
/* No side effect */

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions