Bugzilla – Bug 323418
[GMCS] Error CS0305 using event with generic parameter in partial class
Last modified: 2007-09-15 21:24:23 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".