ambiguous-call

Question about ambiguous calls in C#.

Hi fellow coders, I have a question that's not really a problem, but something that made me a little curious. I have a class with two methods in it. One is a static method and the other one is an instance method. The methods have the same name. public class BlockHeader { public static BlockHeader Peek(BinaryReader reader) { ...

Java ambiguous type for method?

EDIT: This turned out not be a problem with the code at all, but with a bug in the Groovy Eclipse plugin (http://jira.codehaus.org/browse/GRECLIPSE-373) Eclipse is giving me a weird error message about ambiguous types in a Java program and I really don't understand why. I have an interface that takes a generic parameter indicating what ...

C++ templates and ambiguity problem

I have a subset of a pointer class that look like: template <typename T> struct Pointer { Pointer(); Pointer(T *const x); Pointer(const Pointer &x); template <typename t> Pointer(const Pointer<t> &x); operator T *() const; }; The goal of the last constructor is to allow to pass a Pointer of a subclass, o...

Avoiding an ambiguous match exception

I am invoking a static method Parse on a type via reflection because I do not know the type of the object at compile-time (I do know, however, it has a Parse method, taking a string). However, I am getting an ambiguous match exception, presumably because there are a lot of overloaded Parse methods each taking a single object (string, in...

Ambiguous reference error in VS2010

We have a type called Action in our library. We support VS2005, 2008 and now trying to support VS2010 too. When I include the namespace containing our 'Action' type and also 'System' together in a file and try to use it, it cribs saying ambiguous reference call between our Action type and System.Action delegate. This is happening only in...

Ambiguous function/constructor call in C#

The following code causes a compiler error, as it is ambiguous call but the problem if we use object instead of ArrayList no error happens and the string version works fine; Do you have an explanation for that? class A { public A(string x) { Console.WriteLine("string"); } public A(ArrayList x) { Conso...

How to resolve ambigiously named extension method?

I have a DataTable that I'm trying to enumerate over with the AsEnumerable extension method on System.Linq.Enumerable. The problem is that there is an identically named extension method on System.Data.DataTableExtensions. I need to use both namespaces in my class so removing one of the using statements is not an option. How do I decl...

Why am I getting an "Ambiguous Match" error here?

The page that I'm currently working on searches for various entities based on what portfolio they are in. In order to apply the other search criteria (besides for Portfolio) the page first gets the entities by portfolio and then applies the criteria to them, as shown here: IPortfolioLogic logic = this.objectFactory.GetObject<IPortfolioL...

How to resolve ambiguity when argument is null?

Compiling the following code will return The call is ambiguous between the following methods or properties error. How to resolve it since I can't explicitly convert null to any of those classes? static void Main(string[] args) { Func(null); } void Func(Class1 a) { } void Func(Class2 b) { } ...