sjsonnet icon indicating copy to clipboard operation
sjsonnet copied to clipboard

function name should be included in the error message when not bound in call

Open He-Pin opened this issue 7 months ago • 4 comments

In https://github.com/databricks/sjsonnet/issues/39, @eregon report:

https://github.com/databricks/sjsonnet/issues/39#issuecomment-2910409056

I think he is right here, and I think the function name should be included in the error message, eg:

    test("unboundParam") {
      val ex = intercept[Exception] {
        eval(
          """local newParams(x, y) = {
            |  x: x,
            |  y: y,
            |};
            |
            |local params = newParams("a");
            |
            |params.y
            |
        """.stripMargin,
          useNewEvaluator = useNewEvaluator
        )
      }

      assert(ex.getMessage.contains("Function parameter y not bound in call"))
    }

can be Function parameter y not bound in call to function newParams

He-Pin avatar May 27 '25 03:05 He-Pin