rascal icon indicating copy to clipboard operation
rascal copied to clipboard

CallFailed highlights the last/wrong parameter

Open Hyper445 opened this issue 2 years ago • 0 comments

Describe the bug

Whenever a function is called where the types or the arity of the parameters do not match the parameters of the function, the last parameter is highlighted. However, the last parameter might not be the one causing the error.

To Reproduce

Steps to reproduce the behaviour:

Define two functions:

int sum(int a, int b) {
    return a + b;
}

and

void get_sum() {
    str a = "3";
    int b = 4;

    println(sum(a, b));
}

Now run get_sum()

Expected behavior Since the type of the variable a does not match the type in the sum function, the error message should highlight a. However, now the error highlights b.

Stack traces CallFailed(["3",4]) at get_sum

Desktop (please complete the following information):

  • Rascal Version v0.7.0

Hyper445 avatar Jul 18 '23 14:07 Hyper445