title: Ambiguity between Class Variables
body: <p>I'm building a system where I have some classes identical to this one:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  
  /// &lt;summary&gt;
  /// Class to handle operations at Status table
  /// &lt;/summary&gt;
  public class Status
  {
      #region Vars and Class Objects
      protected Dados d;
      protected string sql;
      protected Logs log;
      protected Permissoes p;
      protected List&lt;string&gt; Mensagens;
      #endregion
  
      #region Constructor e Destructor
      public Status()
      {
          d = new Dados();
          log = new Logs();
          p = new Permissoes();
          Mensagens = new List&lt;string&gt;();
      }
  
      ~Status()
      {
          d = null;
          p = null;
          log = null;
          sql = null;
      }
      #endregion
  }
  </code></pre>
  
  <p>(Class Logs and Class Permissoes have similar code structure).</p>
  
  <p>In above code, the following errors are being shown by VS2010 IDE, for all declarations inside constructor:</p>
  
  <pre>
  Error                                                           File            Line    Col             
  Ambiguity between 'Status.d' and 'Status.d'                     Status.cs       22      9
  Ambiguity between 'Status.log' and 'Status.log'                 Status.cs       23      9
  Ambiguity between 'Status.p' and 'Status.p'                     Status.cs       24      9
  Ambiguity between 'Status.Mensagens' and 'Status.Mensagens'     Status.cs       25      9
  Ambiguity between 'Status.d' and 'Status.d'                     Prioridades.cs  21      9
  Ambiguity between 'Status.p' and 'Status.p'                     Prioridades.cs  22      9
  Ambiguity between 'Status.log' and 'Status.log'                 Prioridades.cs  23      9
  Ambiguity between 'Status.d' and 'Status.d'                     Prioridades.cs  28      3
  Ambiguity between 'Status.p' and 'Status.p'                     Prioridades.cs  29      9
  Ambiguity between 'Status.log' and 'Status.log'                 Prioridades.cs  30      9
  Ambiguity between 'Status.sql' and 'Status.sql'                 Prioridades.cs  31      9
  Ambiguity between 'Status.p' and 'Status.p'                     Prioridades.cs  45      18
  Ambiguity between 'Status.sql' and 'Status.sql'                 Prioridades.cs  53      5
  Ambiguity between 'Status.d' and 'Status.d'                     Prioridades.cs  54      5
  Ambiguity between 'Status.log' and 'Status.log'                 Prioridades.cs  58      17
  Ambiguity between 'Status.p' and 'Status.p'                     Prioridades.cs  78      18
  Ambiguity between 'Status.sql' and 'Status.sql'                 Prioridades.cs  86      17
  Ambiguity between 'Status.d' and 'Status.d'                     Prioridades.cs  87      17
  Ambiguity between 'Status.log' and 'Status.log'                 Prioridades.cs  88      17
  Ambiguity between 'Status.p' and 'Status.p'                     Prioridades.cs  106     18
  Ambiguity between 'Status.sql' and 'Status.sql'                 Prioridades.cs  114     17
  Ambiguity between 'Status.d' and 'Status.d'                     Prioridades.cs  115     17
  Ambiguity between 'Status.log' and 'Status.log'                 Prioridades.cs  116     17
  Ambiguity between 'Status.p' and 'Status.p'                     Prioridades.cs  136     18
  Ambiguity between 'Status.sql' and 'Status.sql'                 Prioridades.cs  137     13
  Ambiguity between 'Status.d' and 'Status.d'                     Prioridades.cs  138     17
  Ambiguity between 'Status.p' and 'Status.p'                     Prioridades.cs  157     18
  Ambiguity between 'Status.sql' and 'Status.sql'                 Prioridades.cs  158     13
  Ambiguity between 'Status.d' and 'Status.d'                     Prioridades.cs  159     26
  Ambiguity between 'Status.p' and 'Status.p'                     Prioridades.cs  177     18
  Ambiguity between 'Status.sql' and 'Status.sql'                 Prioridades.cs  178     4
  Ambiguity between 'Status.d' and 'Status.d'                     Prioridades.cs  179     17
  </pre>
  
  <p>Strange thing is: I built another system using this very same methodology and it works like a charm. I just copy-pasted these files to another website and I'm modifying the classes to create another system.</p>
  
  <p>Any ideas? It smells like bug...</p>
  
  <p>EDIT:</p>
  
  <p>Just found out. What happened: I copy-pasted Prioridades class, renamed it and used Refactoring on VS2010. It renamed ALL REFERENCES to "Prioridades" to "Status", including the original class... And all got messy.</p>
  
  <p>Solution: be cautious when using Refactoring.</p>
  
  <p>Sorry for this, guys...</p>