ambiguous

Ambiguous method in Java 8, why? [duplicate]

南楼画角 提交于 2019-11-30 08:24:28
This question already has an answer here: Java type inference: reference is ambiguous in Java 8, but not Java 7 2 answers public static void main(String... args){ then(bar()); // Compilation Error } public static <E extends Exception> E bar() { return null; } public static void then(Throwable actual) { } public static void then(CharSequence actual) { } Compilation result (from command line javac Ambiguous.java ) Ambiguous.java:4: error: reference to then is ambiguous then(bar()); ^ both method then(Throwable) in Ambiguous and method then(CharSequence) in Ambiguous match 1 error Why this method

.Net 4.0 System.Web.Security.MembershipProvider ambiguous reference?

浪尽此生 提交于 2019-11-29 05:45:54
I have recently upgraded my BlogEngine.Net installation to 1.6 and .Net 4.0, however, I did not build BlogEngine.Core when I performed the upgrade. However, when I try to build the BlogEngine.Core project now, the compile fails because it cannot load the symbols for (System.Web.Security.)MembershipProvider. I believe this to be a .Net/C#/user problem rather than a BlogEngine issue. The project has a reference to the library System.Web, and the class file (which inherits from MembershipProvider) includes a Using for System.Web.Security. With ReSharper enabled, IntelliSense indicates confusion

Why does the number of elements in a initializer list cause an ambiguous call error?

為{幸葍}努か 提交于 2019-11-29 05:45:08
问题 Why are the first two calls to doSomething OK by the compiler, but using two elements in the list causes an ambiguous call? #include <vector> #include <string> void doSomething(const std::vector<std::string>& data) {} void doSomething(const std::vector<int>& data) {} int main(int argc, char *argv[]) { doSomething({"hello"}); // OK doSomething({"hello", "stack", "overflow"}); // OK doSomething({"hello", "stack"}); // C2668 'doSomething': ambiguous call return 0; } 回答1: What is happening here

request for member `…' is ambiguous in g++

巧了我就是萌 提交于 2019-11-28 09:16:20
I'm getting the following compile error in one of my classes, using gcc 3.4.5 (mingw): src/ModelTester/CModelTesterGui.cpp:1308: error: request for member `addListener' is ambiguous include/utility/ISource.h:26: error: candidates are: void utility::ISource<T>::addListener(utility::IListener<T>*) [with T = const SConsolePacket&] include/utility/ISource.h:26: error: void utility::ISource<T>::addListener(utility::IListener<T>*) [with T = const SControlPacket&] Hopefully you can see that ISource<T> is a template interface that just indicates that the object can be an informer for an object that is

Ambiguous call between overloads of two-way implicit castable types when a derived type of one is passed as parameter

依然范特西╮ 提交于 2019-11-28 07:48:04
问题 (Trying to find a title that sums up a problem can be a very daunting task!) I have the following classes with some overloaded methods that produce a call ambiguity compiler error: public class MyClass { public static void OverloadedMethod(MyClass l) { } public static void OverloadedMethod(MyCastableClass l) { } //Try commenting this out separately from the next implicit operator. //Comment out the resulting offending casts in Test() as well. public static implicit operator MyCastableClass

.Net 4.0 System.Web.Security.MembershipProvider ambiguous reference?

与世无争的帅哥 提交于 2019-11-27 23:24:30
问题 I have recently upgraded my BlogEngine.Net installation to 1.6 and .Net 4.0, however, I did not build BlogEngine.Core when I performed the upgrade. However, when I try to build the BlogEngine.Core project now, the compile fails because it cannot load the symbols for (System.Web.Security.)MembershipProvider. I believe this to be a .Net/C#/user problem rather than a BlogEngine issue. The project has a reference to the library System.Web, and the class file (which inherits from

request for member `…' is ambiguous in g++

房东的猫 提交于 2019-11-27 02:48:41
问题 I'm getting the following compile error in one of my classes, using gcc 3.4.5 (mingw): src/ModelTester/CModelTesterGui.cpp:1308: error: request for member `addListener' is ambiguous include/utility/ISource.h:26: error: candidates are: void utility::ISource<T>::addListener(utility::IListener<T>*) [with T = const SConsolePacket&] include/utility/ISource.h:26: error: void utility::ISource<T>::addListener(utility::IListener<T>*) [with T = const SControlPacket&] Hopefully you can see that ISource

Using float gives “call to overloaded function is ambiguous” error [duplicate]

痞子三分冷 提交于 2019-11-26 19:08:57
This question already has an answer here: Reference to function is ambiguous [duplicate] 2 answers I'm overloading the function add() , but when I used the float datatype it is showing an error. However, when I change it to double , then it's working fine. Why is float causing the error? Code is: #include <iostream> using namespace std; class students{ private: int i; float f; public: void add(int b){ i=b; cout << "First Int: " << i; } void add(float c){ f=c; cout << "Second Int: " << f; } }; int main(){ students obj; obj.add(9); obj.add(5.5); } Errors: In function 'int main()': [Error] call

Using float gives “call to overloaded function is ambiguous” error [duplicate]

两盒软妹~` 提交于 2019-11-26 06:48:44
问题 This question already has an answer here: Reference to function is ambiguous [duplicate] 2 answers I\'m overloading the function add() , but when I used the float datatype it is showing an error. However, when I change it to double , then it\'s working fine. Why is float causing the error? Code is: #include <iostream> using namespace std; class students{ private: int i; float f; public: void add(int b){ i=b; cout << \"First Int: \" << i; } void add(float c){ f=c; cout << \"Second Int: \" << f