Bug 320440 (MONO77674) - [GMCS] incorrect CS0534: gmcs fails to resolve generic method that returns generic argument in abstract class
Summary: [GMCS] incorrect CS0534: gmcs fails to resolve generic method that returns ge...
Status: RESOLVED FIXED
Alias: MONO77674
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-01 09:24 UTC by Atsushi Enomoto
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:50:04 UTC


---- Reported by atsushi@ximian.com 2006-03-01 02:24:38 MST ----

gmcs does not mark 1)overriden methods 2)whose return type is a generic
argument 3)and defined in an abstract class, as actually overriden.

--------
using System;

public abstract class A
{
        public abstract T Foo<T> ();
}

public abstract class B : A
{
        public override T Foo<T> ()
        {
                return default (T);
        }
}

public class C : B
{
}
--------

Actual Results:

test.cs(16,14): error CS0534: `C' does not implement inherited abstract
member `A.Foo<T>()'

Expected Results:

no CS0534 error (only "Main not found").

How often does this happen? 

consistently.

Additional Information:

- If the return type is changed from T to void (or whatever), this CS0534
does not happen.

- If class B is not abstract, then CS0534 does not happen.

- It is only about generic methods. The example code below compiles without
problem, so it does not apply to generic type parameters.

using System;

public abstract class A<T>
{
        public abstract T Foo ();
}

public abstract class B<T> : A<T>
{
        public override T Foo ()
        {
                return default (T);
        }
}

public class C<T> : B<T>
{
}



---- Additional Comments From martin@ximian.com 2006-03-09 07:34:36 MST ----

I have an idea about this one, will have a look at it tomorrow.



---- Additional Comments From martin@ximian.com 2006-03-12 15:13:52 MST ----

Fixed in SVN.


Unknown operating system unknown. Setting to default OS "Other".