{
  "schema": "ailang/v0",
  "name": "test_recur_not_in_tail_position",
  "imports": [],
  "defs": [
    {
      "kind": "fn",
      "name": "bad_recur",
      "type": {
        "k": "fn",
        "params": [
          {
            "k": "con",
            "name": "Int"
          }
        ],
        "param_modes": [
          "own"
        ],
        "ret": {
          "k": "con",
          "name": "Int"
        },
        "ret_mode": "own",
        "effects": []
      },
      "params": [
        "n"
      ],
      "doc": "loop-recur iter 2: recur as an argument to + is NOT in tail position -> recur-not-in-tail-position.",
      "body": {
        "t": "loop",
        "binders": [
          {
            "name": "i",
            "type": {
              "k": "con",
              "name": "Int"
            },
            "init": {
              "t": "lit",
              "lit": {
                "kind": "int",
                "value": 0
              }
            }
          }
        ],
        "body": {
          "t": "app",
          "fn": {
            "t": "var",
            "name": "+"
          },
          "args": [
            {
              "t": "lit",
              "lit": {
                "kind": "int",
                "value": 1
              }
            },
            {
              "t": "recur",
              "args": [
                {
                  "t": "app",
                  "fn": {
                    "t": "var",
                    "name": "+"
                  },
                  "args": [
                    {
                      "t": "var",
                      "name": "i"
                    },
                    {
                      "t": "lit",
                      "lit": {
                        "kind": "int",
                        "value": 1
                      }
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    }
  ]
}
