![]() |
|
Navigation |
Synopsis The called signature does not match any defined function.
Description A function has a name and a signature (the names and types of its arguments).
This error is reported when a call of a function cannot be associated with a function declaration.
Remedies:
Examples Define a function
triple that multiplies its argument by 3:
rascal>int triple(int x) = 3 * x;
int (int): int triple(int);
It works fine:
rascal>triple(5)
int: 15
Unless it is called with an argument of a wrong type:
rascal>triple([1,2,3])
|stdin:///|(0,15,<1,0>,<1,15>): The called signature: triple(list[int]),
does not match the declared signature: int triple(int);
We can define a new version of triple function that accepts lists:
rascal>list[int] triple(list[int] L) = [3 * x | x <- L]; list[int] (list[int]): list[int] triple(list[int]); rascal>triple([1,2,3]); list[int]: [3,6,9] ![]() |