2007-11-13 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Tue, 13 Nov 2007 09:46:13 +0000 (09:46 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 13 Nov 2007 09:46:13 +0000 (09:46 -0000)
  A fix for bug #325359
  * class.cs: Use predictable name for automatically generated property.

svn path=/trunk/mcs/; revision=89533

mcs/mcs/ChangeLog
mcs/mcs/class.cs

index 2a56422f8e977261460af57b28c4f45f42eaf1c7..2e5766672c2b94521194b0db2e7f1aa8ea56d122 100644 (file)
@@ -1,3 +1,8 @@
+2007-11-13  Marek Safar  <marek.safar@gmail.com>
+
+       A fix for bug #325359
+       * class.cs: Use predictable name for automatically generated property.
+       
 2007-11-12  Marek Safar  <marek.safar@gmail.com>
 
        A fix for bug #324996
index 67b1ba5e44ca193f33dbee84794182fddc3b6c7c..fbe712641741e176bc9e8affcf6ce6f9d28b638d 100644 (file)
@@ -6916,7 +6916,7 @@ namespace Mono.CSharp {
                        Modifiers.SEALED |
                        Modifiers.OVERRIDE |
                        Modifiers.ABSTRACT |
-                       Modifiers.UNSAFE |
+                       Modifiers.UNSAFE |
                        Modifiers.EXTERN |
                        Modifiers.METHOD_YIELDS |
                        Modifiers.VIRTUAL;
@@ -6930,8 +6930,7 @@ namespace Mono.CSharp {
                        Field field = new Field (
                                Parent, Type,
                                Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (ModFlags & Modifiers.STATIC),
-                               CompilerGeneratedClass.MakeName (null, "CompilerGeneratedField"),
-                               null, Location);
+                           "<" + Name + ">k__BackingField", null, Location);
                        ((TypeContainer)Parent).AddField (field);
 
                        // Make get block
@@ -6963,12 +6962,14 @@ namespace Mono.CSharp {
                                is_iface ? AllowedInterfaceModifiers : AllowedModifiers,
                                is_iface, name, attrs, define_set_first)
                {
-                       if (RootContext.Version >= LanguageVersion.LINQ &&
-                               !is_iface &&
-                               (mod & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0 &&
+                       if (!is_iface && (mod & (Modifiers.ABSTRACT | Modifiers.EXTERN)) == 0 &&
                                get_block != null && get_block.Block == null &&
-                               set_block != null && set_block.Block == null)
+                               set_block != null && set_block.Block == null) {
+                               if (RootContext.Version <= LanguageVersion.ISO_2)
+                                       Report.FeatureIsNotAvailable (Location, "automatically implemented properties");
+                               
                                CreateAutomaticProperty (current_block, get_block, set_block);
+                       }
 
                        if (get_block == null)
                                Get = new GetMethod (this);