Bug 30664 - MethodInfo.Module throws NotImplementedException
Summary: MethodInfo.Module throws NotImplementedException
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
Depends on:
Reported: 2015-06-02 07:47 UTC by Piotr Zierhoffer
Modified: 2015-06-03 04:39 UTC (History)
3 users (show)

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:

Description Piotr Zierhoffer 2015-06-02 07:47:57 UTC
Compile and run the following code:

var module = typeof(MainClass).GetMethod ("Main").Module;

On .NET it works fine, fails with NotImplementedException on Mono cb9a09b3f06c5539f01c877d329eddde79c01597 (and quite a few earlier versions).

I can see the appropriate throw in referencesources, but I assume there should be an override somewhere in the class hierarchy.

This property is, unfortunately, heavily used by IronPython (Src/Microsoft.Dynamic/Runtime/ReflectionCache.cs+MethodBaseCache.CompareMethods)
Comment 1 Marek Safar 2015-06-02 11:10:53 UTC
I cannot reproduce this

var module = typeof(MainClass).GetMethod ("Main").Module;

works for me as expected. Could you paste full stacktrace (ideally with logger this type) and ensure you are running revision 1396b52d9672df3b69a8e3f6b0166255ba653e19 at least
Comment 2 Piotr Zierhoffer 2015-06-03 03:31:50 UTC
I don't know how this happen, but my compilation must have failed me on trunk.

This is actually resolved, so sorry for the hassle.
Comment 3 Marek Safar 2015-06-03 04:39:34 UTC
Resolved based on comment #2