[Mono-bugs] [Bug 325481] Cannot distinguish CustomAttribute values that are Types from Strings

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri May 2 08:02:04 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=325481

User jeff.brown at gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=325481#c1





--- Comment #1 from Jeff Brown <jeff.brown at gmail.com>  2008-05-02 06:02:04 MST ---
Created an attachment (id=211962)
 --> (https://bugzilla.novell.com/attachment.cgi?id=211962)
A partial patch for supporting more deeply structured attribute values.

This is a partial patch for supporting more deeply structured attribute values.
 It replaces the CustomAttrib.Enum type and some members of CustomAttribute
with a simple recursively composable ConstantValue structure.

This structure supports arrays and unresolved enumerations without requiring
any of the previous hacks.

I've lightly tested the metadata reader but not the writer components.  (Where
are the tests in the source tree?)

To be truly effective, this patch should be augmented to also work with custom
security pseudo attributes and to eliminate the concept of "unresolved" custom
attributes altogether.  I'm sure CustomAttribute.IsResolver, Blob, and Resolve
can all be eliminated.

It might also be helpful for some people to provide a means of resolving
attribute values to native types when possible.  Gallio does this in its own
ConstantValue structure (which is essentially a higher-level abstraction around
several reflection policies including one based on Cecil) by means of a
Resolve() method.  Calling Resolve() will try to map type references to native
types, and the underlying primitive values of enums to actual typed enum
values.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list