phylanx icon indicating copy to clipboard operation
phylanx copied to clipboard

Physl error message for out of bound number of arguments is not precise

Open taless474 opened this issue 6 years ago • 1 comments

For conv1d we have this match data pattern:

        hpx::util::make_tuple("conv1d",
        std::vector<std::string>{R"(
            conv1d(_1, _2_kernel,
            __arg(_3_padding, "valid"),
            __arg(_4_strides, 1),
            __arg(_5_dilation_rate, 1))
        )"}

At least 2 arguments should be supplied. The second argument is named, but does not have a default value. Having the following in physl:

conv1d([1,2,3], [1,2,3], "valid", 2, 1, 1, 3)

would result in:

physl: exception caught:
physl.txt(411, 1): attempt to call function 'conv1d' with too many arguments (expected: 1, supplied: 7): HPX(bad_parameter)

The expected number of arguments is 2 not 1 .It would have been more informative if the message was

physl: exception caught:
physl.txt(411, 1): attempt to call function 'conv1d' with too many arguments (expected: 2, allowed: 5, supplied: 7): HPX(bad_parameter)

taless474 avatar May 21 '19 15:05 taless474

Good catch!

hkaiser avatar May 21 '19 22:05 hkaiser