Re: [Ikvm-developers] Using Java annotation class fails with Mono.
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2010-07-22 15:11:19
|
Hi Dawid,
> I have a bug (?) I couldn't understand the source of, perhaps you'll
> share my interest in finding out what's happening.
This is a gmcs bug.
> When looking at the decompilation of BindableAttribute (which is the
> annotation's implementation class generated by ikvm) one sees this:
>
> .method private newslot virtual final instance string prefix() cil
> managed
> {
> // ...
> }
>
> .property instance string prefix
> {
> .get instance string
> org.carrot2.util.attribute.BindableAttribute::get_prefix()
> .set instance void
> org.carrot2.util.attribute.BindableAttribute::set_prefix(string)
> }
>
> I find the following things interesting:
>
> a) prefix() is a virtual override, but is marked private? Is scope
> limiting (as opposed to widening) possible at the CLR/CLI level? It's
> quite interesting as to how and where this would apply to (after all,
> you can always cast to the superclass/interface and then access the
> method in question, right?).
This is not all that extraordinary. The C# compiler uses this same pattern for explicit interface implementations.
> b) C# compiler doesn't seem to accept a method and a property of the
> same name to coexist. I assume that, again, the rules for CLR/CLI are
> less restrictive than C# semantics (as it is the case with JVM and
> Java), but my suspicion is that this confuses Mono and it takes the
> methods as the first match, as opposed to the property getter, hence the
> error above.
Exactly. I don't think that there is ever a valid reason for the C# compiler to look at private members (other than maybe improved error reporting).
> This isn't urgent my any means, but if anybody finds some time to
> enlighten me, I'd be very grateful.
Could you please file a Mono bug?
Regards,
Jeroen
|