Reporter | Vladimir Reshetnikov (nikov) |
---|---|
Created | Apr 14, 2012 7:52:26 AM |
Updated | Apr 14, 2012 7:52:26 AM |
Priority | Normal |
Type | Bug |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Unassigned |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
class C { static void Bar() { var obj = new { x = 1 }; var x = 1; // Rename local variable x to y var z = Foo(obj, new {x}).ToLower(); } static string Foo<T>(T x, T y) { return ""; } static void Foo(object x, object y) { } }
Actual:
class C { static void Bar() { var obj = new { x = 1 }; var y = 1; var z = Foo(obj, new { y }).ToLower(); // error CS0023: Operator '.' cannot be applied to operand of type 'void' } static string Foo<T>(T x, T y) { return ""; } static void Foo(object x, object y) { } }
Expected:
class C { static void Bar() { var obj = new { x = 1 }; var y = 1; var z = Foo(obj, new { x = y }).ToLower(); // OK } static string Foo<T>(T x, T y) { return ""; } static void Foo(object x, object y) { } }