Bug 323418 (MONO80731) - [GMCS] Error CS0305 using event with generic parameter in partial class
Summary: [GMCS] Error CS0305 using event with generic parameter in partial class
Status: RESOLVED FIXED
Alias: MONO80731
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-05 21:17 UTC by Frederik Carlier
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
Files needed to reproduce the issue. (311 bytes, application/octet-stream)
2007-02-05 21:19 UTC, Thomas Wiest
Details

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


---- Reported by frederik.carlier@ugent.be 2007-02-05 14:17:36 MST ----

Description of Problem:

Say you have this kind of class
    public partial class Test<T> 
    {
        public delegate void TestDelegate(object sender, T value);
        public virtual event TestDelegate TestEvent;
    }
Using a certain construct of partial classes, this will generate a CS0305
error. See below for repro steps.

Steps to reproduce the problem:
1. Unzip the attached files to a folder, say ~/monohttps://bugzilla.novell.com/show_bug.cgi?id=MONO2. gmcs Test.Designer.cs Test.cs -target:library

Actual Results:
Test.cs(6,31): error CS0305: Using the generic type
`Monobug.Test<T>.TestDelegate' requires 1 type arguments
Compilation failed: 1 error(s), 0 warnings

Expected Results:
Compilation to succeed

How often does this happen? 
Always

Additional Information:
Note that when calling
gmcs Test.cs Test.Designer.cs -target:library
compilation works fine. In other words, the compilation depends on the
order in which the files are specified -- which is clearly wrong. 

I am using the SVN version from Mono (as from February, 04, 2007). This
relates to, but is not a duplicate of, https://bugzilla.novell.com/show_bug.cgi?id=MONO80358 .



---- Additional Comments From frederik.carlier@ugent.be 2007-02-05 14:19:05 MST ----

Created an attachment (id=171393)
Files needed to reproduce the issue.




---- Additional Comments From frederik.carlier@ugent.be 2007-02-05 14:24:12 MST ----

fix typo in summary



---- Additional Comments From peterw@home.se 2007-02-18 17:52:52 MST ----

I get a similar problem. Trying to compile the following code (with
gmcs 1.2.3.1) also gives error 
test.cs(7,5): error CS0305: Using the generic type `A<T>.B' requires 1
type arguments.
The code:
partial class A<T>
{
    class B {}
}
partial class A<T>
{
    B b;
}




---- Additional Comments From martin@ximian.com 2007-03-13 10:18:55 MST ----

=====
namespace Monobug
{
    public partial class Test<T>
    {
            public delegate void TestDelegate(object sender, T value);
                public virtual event TestDelegate TestEvent;
    }
}
=====

and

=====
namespace Monobug
{
    partial class Test<T>
    {
    }
}
=====



---- Additional Comments From martin@ximian.com 2007-03-13 10:19:11 MST ----

-> assi.



---- Additional Comments From martin@ximian.com 2007-03-15 11:05:51 MST ----

Fixed in SVN; added gtest-315.

Imported an attachment (id=171393)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>Ubuntu Edgy Eft, using Mono SVN</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".