null coalescing operator - Reflector's bug?

Explore, browse and analyze .NET assemblies

Moderators: Luke Jefferson, Charles Brown, StephenC, Alex.Davies, Greg.Tillman, melvyn.harbour

null coalescing operator - Reflector's bug?

Postby chaleks » Sat Nov 27, 2010 5:50 pm

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

C# Code:
===============
Code: Select all
private static string host; 
public static string Host 
{       
    get 
    { 
        return host ?? (host= (ConfigurationManager.AppSettings["Host"] ?? "host.ru")); 
    } 
}

===============
Reflector's output:
===============
Code: Select all
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
 
Posts: 1
Joined: Sat Nov 27, 2010 5:38 pm

Postby Clive Tong » Mon Nov 29, 2010 10:38 am

Thanks for reporting this. I've logged it as issue RP-779. and will investigate it further.
Clive Tong
 
Posts: 283
Joined: Thu Dec 04, 2008 5:42 pm


Return to .Net Reflector 6.x and .NET Reflector 6.x Pro

Who is online

Users browsing this forum: No registered users and 0 guests