Reporter | Julien Lebosquain (mrjul) |
---|---|
Created | Feb 8, 2012 7:59:51 PM |
Updated | Feb 8, 2012 7:59:51 PM |
Priority | Normal |
Type | Bug |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Alexey Kuptsov (alexey.kuptsov) |
Subsystem | Context actions |
Affected versions | 6.1 |
Fixed in build | No Fixed in build |
class Base { } class Derived : Base { public int Prop { get; set; } } Base b = new Derived() { Prop = 2 };
On "new Derived", executing the context action "Extract Prop to assignment statement" turns the code into :
Base b = new Derived(); b.Prop = 2;
There is no Prop member on Base so compilation fails. Please either disable the context action or add a cast to Derived.