Note that there are some explanatory texts on larger screens.

plurals
  1. POOverloaded method signatures - compiler see nullable types as synynomous to regular value type
    primarykey
    data
    text
    <p>We have a library with many methods that are overloaded with the method signature changing from value type to nullable value type as you see below:</p> <p>A.) <code>IsEmpty(int obj, int defaultValue)</code></p> <p>B.) <code>IsEmpty(int? obj, int defaultValue)</code></p> <p>As you can see the only difference is that B is nullable. On most workstations in my office, this overloading compiles and the types are recognized as truly distinct.</p> <p>However, for some reason, all of my machines and VMs will not compile. We are currently baffled as to why this is happening. The machines I am using should be near mirror images of other machines that are working/compiling.</p> <p><strong>Here is a sample of the error that ensues during compilation:</strong></p> <blockquote> <ul> <li><p>Error 28 The call is ambiguous between the following methods or properties: 'BayTech.Common.Fix.IfEmpty(System.Guid, System.Guid)' and 'BayTech.Common.Fix.IfEmpty(System.Guid, System.Guid?)' C:\Projects\Applications\JukeWeb\BayTech\Internal\Common Library\VS2010\Apps\BayTech.Common\Conversion\Fix.Empty.SL.cs 55 17 BayTech.Common</p></li> <li><p>Error 11 The call is ambiguous between the following methods or properties: 'BayTech.Common.Fix.IfEmpty(System.DateTime, System.DateTime)' and 'BayTech.Common.Fix.IfEmpty(System.DateTime, System.DateTime?)' C:\Projects\Applications\JukeWeb\BayTech\Internal\Common Library\VS2010\Apps\BayTech.Common\Conversion\Fix.Empty.SL.cs 35 17 BayTech.Common</p></li> <li><p>Error 165 The call is ambiguous between the following methods or properties: 'BayTech.Common.Fix.IfEmpty(string, System.Guid)' and 'BayTech.Common.Fix.IfEmpty(string, System.Guid?)' C:\Projects\Applications\JukeWeb\BayTech\Internal\Common Library\VS2010\Apps\BayTech.Common\Conversion\Fix.IfEmpty.Xml.cs 259 17 BayTech.Common</p></li> </ul> </blockquote> <p>Does anyone have an idea why this would be happening?</p> <p><strong>Here's some information on the environment setup:</strong></p> <ul> <li>VS2010</li> <li>Idealblade (most recent install)</li> <li>Telerik controls installed including Just-In-Code</li> <li>All services packs included for VS and Windows 7</li> <li>All services packs included for VS and Windows 7</li> <li>Win7 Ultimate</li> <li>SQL 2008 R2 </li> <li>VSExtensions for T4 templates, PostSharp, </li> <li>Codesmith Professional installed</li> <li>VisualSVN installed</li> <li>DevExpress</li> <li>SQLComplete installed</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload