[System] Rename variable to fix bootstrapping with Mono 3.10 mcs
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 11 May 2016 12:36:57 +0000 (14:36 +0200)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 11 May 2016 12:37:24 +0000 (14:37 +0200)
We were seeing compilation errors like this:

```
System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs(71,20): error CS0135: `oid' conflicts with a declaration in a child block
System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs(74,17): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 38 warnings
make[9]: *** [../../class/lib/basic/secxml/System.dll] Error 1
```

The new foreach variables introduced in 4a6e5d24e174b9d2860300503b4a79396d7ae96d with the same "oid" name as the global constant apparently confused the older mcs compiler.

Rename them to avoid this.

mcs/class/System/System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs

index eeabf6905e3dcaab28bb514cde75d7419e5212ac..681b8ff8be857fd4d4e7a37490b7fd8a0c90c2c4 100644 (file)
@@ -71,8 +71,8 @@ namespace System.Security.Cryptography.X509Certificates {
                        _oid = new Oid (oid, friendlyName);
                        base.Critical = critical;
                        _enhKeyUsage = new OidCollection();
-                       foreach (Oid oid in enhancedKeyUsages) {
-                               _enhKeyUsage.Add(oid);
+                       foreach (Oid o in enhancedKeyUsages) {
+                               _enhKeyUsage.Add(o);
                        }
                        RawData = Encode ();
                }
@@ -87,8 +87,8 @@ namespace System.Security.Cryptography.X509Certificates {
 
                                        OidCollection oids = new OidCollection();
                                        if (_enhKeyUsage != null) {
-                                               foreach(Oid oid in _enhKeyUsage) {
-                                                       oids.Add(oid);
+                                               foreach(Oid o in _enhKeyUsage) {
+                                                       oids.Add(o);
                                                }
                                        }
                                        return oids;
@@ -150,8 +150,8 @@ namespace System.Security.Cryptography.X509Certificates {
                internal byte[] Encode ()
                {
                        ASN1 ex = new ASN1 (0x30);
-                       foreach (Oid oid in _enhKeyUsage) {
-                               ex.Add (ASN1Convert.FromOid (oid.Value));
+                       foreach (Oid o in _enhKeyUsage) {
+                               ex.Add (ASN1Convert.FromOid (o.Value));
                        }
                        return ex.GetBytes ();
                }