[Mono-bugs] [Bug 378088] Microsoft.CSharp. CSharpCodeGenerator generates bad syntax for abstract properties.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 9 11:43:17 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=378088

User jbevain at novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=378088#c9


Jb Evain <jbevain at novell.com> changed:

           What    |Removed                                         |Added
----------------------------------------------------------------------------
             Status|REOPENED                                        |RESOLVED
         Resolution|                                                |FIXED




--- Comment #9 from Jb Evain <jbevain at novell.com>  2008-04-09 09:43:17 MST ---
Alright, I've commited a proper fix to both HEAD and the 1.9 branch. In case
you're interested, here it is:

Index: CSharpCodeGenerator.cs
===================================================================
--- CSharpCodeGenerator.cs      (revision 100230)
+++ CSharpCodeGenerator.cs      (working copy)
 -705,6 +705,11 @@
                        }
                }

+               static bool IsAbstract (MemberAttributes attributes)
+               {
+                       return (attributes & MemberAttributes.ScopeMask) ==
MemberAttributes.Abstract;
+               }
+
                protected override void GenerateProperty (CodeMemberProperty
property,
                                                          CodeTypeDeclaration
declaration)
                {
 -748,7 +753,7 @@
                        OutputStartBrace ();
                        ++Indent;

-                       if (declaration.IsInterface)
+                       if (declaration.IsInterface || IsAbstract
(property.Attributes))
                        {
                                if (property.HasGet) output.WriteLine("get;");
                                if (property.HasSet) output.WriteLine("set;");
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 100230)
+++ ChangeLog   (working copy)
 -1,3 +1,9 @@
+2008-04-09  Jb Evain  <jbevain at novell.com>
+
+       * CSharpCodeGenerator.cs: Emit bodyless getters and setters
+       for abstract properties. Based on a patch by
+       Stefan Rusek <stefan at fogcreek.com>
+
 2008-02-27  Marek Habersack  <mhabersack at novell.com>

        * CSharpCodeCompiler.cs: use asynchronous method of capturing mcs


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list