ambiguous selection

21 views
Skip to first unread message

Ralf Hemmecke

unread,
Feb 24, 2021, 8:26:36 AM2/24/21
to fricas-devel
In my code I have two functions with exactly the same signatures but
coming from different domains. I have compiled the code inside my
session and after )set message bottom on I get.

(58) -> width(8,2)

Function Selection for width
Arguments: (PI, PI)

[1] signature: (PI, INT) -> INT
implemented: slot (Integer)(PositiveInteger)(Integer) from GAMMA0
[2] signature: (PI, INT) -> INT
implemented: slot (Integer)(PositiveInteger)(Integer) from GAMMA1


(58) 2
Type: PositiveInteger

Unfortunately, I do not see a warning and I get the wrong result.
Needless to say that this is a very dangerous source of errors.
Here I was expecting to get 4 as an answer.

Would it be hard to add a switch to FriCAS that tells it to SHOUT
whenever there is ambiguity during function selection?

Even if it is considered a feature that the interpreter tries to do the
right thing, it can be terribly wrong and I have no chance to recognize
this easily.

Ralf
Reply all
Reply to author
Forward
0 new messages