Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-288208: Extract to assignment statement breaks code

$
0
0
Reporter Julien Lebosquain (mrjul) 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.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>