Bug 3315 - Implement explicit is broken
Summary: Implement explicit is broken
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2012-02-09 11:04 UTC by Alan McGovern
Modified: 2012-02-09 12:35 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Alan McGovern 2012-02-09 11:04:03 UTC
Two issues:
1) It attempted to explicitly implement methods in 'object' which is incorrect.
2) void Foo<>.MyMethod (int foo, bool bar)
It explicitly implements generic interfaces incorrectly as the type parameter is missing. It should be Foo<int> not Foo<>



	public interface Foo<T>
	{
		void MyMethod (int foo, bool bar);
		int Foobar<U> (T t, U u);
	}
	
	public class Baz : Foo<int>
	{
		#region Foo implementation
		bool object.Equals (object obj)
		{
			return base.Equals (obj);
		}

		public static bool Equals (object objA, object objB)
		{
			throw new System.NotImplementedException ();
		}

		void object.Finalize ()
		{
			base.Finalize ();
		}

		int object.GetHashCode ()
		{
			return base.GetHashCode ();
		}

		Type object.GetType ()
		{
			throw new System.NotImplementedException ();
		}

		object object.MemberwiseClone ()
		{
			throw new System.NotImplementedException ();
		}

		string object.ToString ()
		{
			return string.Format ("[Baz]");
		}

		bool object.ReferenceEquals (object objA, object objB)
		{
			throw new System.NotImplementedException ();
		}

		void Foo<>.MyMethod (int foo, bool bar)
		{
			throw new System.NotImplementedException ();
		}

		int Foo<>.Foobar<U> (int t, U u) where U : object
		{
			throw new System.NotImplementedException ();
		}
		#endregion
	}
Comment 1 Alan McGovern 2012-02-09 12:35:06 UTC
Fixed in git.