Reporter | Vladimir Reshetnikov (nikov) |
---|---|
Created | Sep 30, 2009 12:40:40 AM |
Updated | Apr 26, 2012 2:44:10 AM |
Priority | Major |
Type | Feature |
Fix versions | Mirabile Futurum |
State | Open |
Assignee | Alexey Kuptsov (alexey.kuptsov) |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
static int Foo(string s, DayOfWeek d) { int result = 0; if (s != null) // Invert if { result = int.Parse(s); switch (d) { case DayOfWeek.Sunday: return result; default: return -result; } } Debug.WriteLine("null"); return result; }
Actual result:
static int Foo(string s, DayOfWeek d) { int result = 0; if (s == null) { // Grr! } else { result = int.Parse(s); switch (d) { case DayOfWeek.Sunday: return result; default: return -result; } } Debug.WriteLine("null"); return result; }
Expected result:
static int Foo(string s, DayOfWeek d) { int result = 0; if (s == null) { Debug.WriteLine("null"); return result; } result = int.Parse(s); switch (d) { case DayOfWeek.Sunday: return result; default: return -result; } }