[Mono-dev] [PATCH] Bug in MonoType.GetField(FieldInfo)

Cedric Vivier cedricv at neonux.com
Mon Feb 12 06:15:50 EST 2007


Also forgot to mention the same codepath using
TypeBuilder.GetField(Type, FieldInfo) works on MS.NET, and that we
should add some checks to TypeBuilder.GetField(Type, FieldInfo) to
ensure the type is a generic one, as defined in documentation.

On 2/9/07, Cedric Vivier <cedricv at neonux.com> wrote:
> Hi all!
> We - as in mono+boo users;) - have been hitting a blocking compilation
> bug on the latest boo revisions supporting generics generators.
> The bug is related to method MonoType.GetField(FieldInfo) only
> returning public fields (because of the use of the default public-only
> BindingFlags as used in the Type.GetField(string) method), whereas
> FieldInfo can obviously "reference" a non-public field too.
> Thus, we were getting a "field not found" exception from caller
> TypeBuilder.GetField(Type, FieldInfo) when building a generics class
> with a non-public field.
> Attached a patch fixing this, with the corresponding testcase :)
> Regards,

More information about the Mono-devel-list mailing list