How can we help you today? How can we help you today?

null coalescing operator - Reflector's bug?

I have encountered the following issue.
http://stackoverflow.com/questions/4292 ... ectors-bug

C# Code:
===============
private static string host;  
public static string Host  
{        
    get  
    {  
        return host ?? (host= (ConfigurationManager.AppSettings["Host"] ?? "host.ru"));  
    }  
}
===============
Reflector's output:
===============
public static string Host 
{  
    get  
    {  
        if (Helper.host == null)  
        {  
            string host = Helper.host;  
        }  
        return (Helper.host = ConfigurationManager.AppSettings["Host"] ?? "host.ru");  
    }  
}

Those pieces of code mean different logics. Is this a bug?
chaleks
0

Comments

1 comment

  • Clive Tong
    Thanks for reporting this. I've logged it as issue RP-779. and will investigate it further.
    Clive Tong
    0

Add comment

Please sign in to leave a comment.