ambiguous method invoking, 2 compatible methods
billcollis opened this issue · comments
In the following code a function prototype is used and an error is thrown
`#include
using namespace std;
int func(int x);
int main() {
int a;
cin >> a;
a = func(5); //fails
//a = func(a); //works
cout << a << endl;
return 0;
}
int func(int x){
x*= 10 ;
return x;
}`
it appears that the number '5' is of type 'unsigned int' so when getCompatibleFunction sees two possible functions (the prototype and the actual function) it throws the error.
Thanks for reporting! I just pushed the fix.