Bug 17638 - GetMethods returns private methods where it should not
Summary: GetMethods returns private methods where it should not
Status: RESOLVED NORESPONSE
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Rodrigo Kumpera
URL:
Depends on:
Blocks:
 
Reported: 2014-02-06 10:23 UTC by Marek Safar
Modified: 2016-04-14 07:00 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 GitHub or Developer Community 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 NORESPONSE

Description Marek Safar 2014-02-06 10:23:37 UTC
using System;
using System.Reflection;

public class PP : Object
{
}

class X
{
	public static void Main ()
	{
		var all = typeof(PP).GetMethods (BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static );
		foreach (var m in all) {
			Console.WriteLine (m);
		}
	}
}

.NET

Void Finalize()
System.Object MemberwiseClone()

Mono

Void Finalize()
System.Object MemberwiseClone()
IntPtr obj_address()

I did some digging and ended up in 

		case METHOD_ATTRIBUTE_ASSEM:
			return (start_klass || mono_defaults.generic_ilist_class);

which looks suspicious to me
Comment 1 Rodrigo Kumpera 2014-02-12 14:49:48 UTC
Working on it.

Going balistic on this one.
Comment 2 Rodrigo Kumpera 2014-02-12 15:38:25 UTC
This is not a bug, it just shows the fact that mono has an internal method called obj_address and MS doesn't.
Comment 3 Marek Safar 2014-02-12 16:04:09 UTC
It's bug because even if .net had internal method it'd not show up. You can simulate this with non-object case as well.
Comment 4 Rodrigo Kumpera 2014-02-12 18:10:27 UTC
I could not write a test case for what you're describing. I need a test case because I could not find any differences when listing all combinations of method visibility with all combinations of visibility flags.
Comment 5 Rodrigo Kumpera 2016-04-14 07:00:48 UTC
Looks like we gave up on this one.