Bug 28184 - ParameterInfo.GetCustomAttributes returns null in some cases
Summary: ParameterInfo.GetCustomAttributes returns null in some cases
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2015-03-19 05:34 UTC by Dylan Borg
Modified: 2015-03-19 17:43 UTC (History)
3 users (show)

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


Attachments
repro with result in comments (700 bytes, text/plain)
2015-03-19 11:22 UTC, Dylan Borg
Details


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 FIXED

Description Dylan Borg 2015-03-19 05:34:51 UTC
While using ASP.NET 5 on the latest code from master, I am getting a null output when getting custom attributes from a ParameterInfo instance. The spec says that an empty collection/array should be output when no attributes are found. In my case there are attributes yet null is mysteriously returned. I have tries to trawl the mono code base + reference-source but still could not find what is causing this. I believe that everything was OK before mono switched to the Microsoft version of the System.Attribute class.
Comment 1 Marek Safar 2015-03-19 08:34:10 UTC
I'd need some kind of repro to track it down.
Comment 2 Dylan Borg 2015-03-19 11:22:04 UTC
I did a repro using just one file's wort of code and confirmed the issue. See the attachment for the code and what came out of it.
Comment 3 Dylan Borg 2015-03-19 11:22:50 UTC
Created attachment 10413 [details]
repro with result in comments
Comment 4 Marek Safar 2015-03-19 17:43:17 UTC
Fixed in master